I have got a simple TCPlistener that listens for connections and once a connection has been established, a method tries to send data and the server side tries to read it.
client side:
using (NetworkStream stream = new NetworkStream(_client.Client, false))
{
Serializer.Serialize(stream, MyPersonObject);
}
Server side:
using (NetworkStream stream = new NetworkStream(_client.Client, false))
{
var myObject = Serializer.DeSerialize<Person>(stream);
}
However, I've noticed that once it hits the DeSerialize method, it hangs and waits indefinitely. Note that this does NOT happen with BinaryFormatter using the exact same steps. I am not sure what's wrong.