Open aviramha opened 2 years ago
I'm also wondering if there is a specific reason that actix-codec is distinct from tokio-util::codec
I'm also wondering if there is a specific reason that actix-codec is distinct from tokio-util::codec
Ah! I didn't even notice it. TBH I solved it by creating 2 codecs, one for the "client" and other for the "server" which each one encodes/decodes different data.. not sure how elegant it is (prior solution was a generic codec)
Right now the codec supports only IO that has both
AsyncRead
andAsyncWrite
. I have a situation where the incoming codec != outgoing codec (different messages and I'd like to distinguish). Ideally, I could useTcpStream::split()
then create each half with a codec, but I can't do that because of both traits required. I'm thinking we should add ReadFramed and WriteFramed to support that.