I have two parts, a client and a server. And I try to send data (size > 5840 Bytes) from the client to the server and then the server sends the data back. I loop this a number o
I am no expert but don't you think calling stream.Close() on Client will close stream while server is still trying to write at
// Send back a response. stream.Write(bytes, 0, size);
Also you may want to put some data to mark end of it, so that server knows and stops reading.