0
0to60
I'm using a BinaryFormatter to serialize objects over the NetworkStream of a
TcpClient. I'd like to sit and wait for messages to come in and then
respond accordingly. As far as I know, to do this I have to start a thread
and block on formatter.Deserialize() until a message comes in, then loop
back around and repeat. Basically, I'll always have a thread blocking.
Is there a better way to do this? Ideally, I'd like to do something like
formatter.BeginDeserialize(callBack), but that method doesn't exist.
TcpClient. I'd like to sit and wait for messages to come in and then
respond accordingly. As far as I know, to do this I have to start a thread
and block on formatter.Deserialize() until a message comes in, then loop
back around and repeat. Basically, I'll always have a thread blocking.
Is there a better way to do this? Ideally, I'd like to do something like
formatter.BeginDeserialize(callBack), but that method doesn't exist.