We have a Windows Service hosting a TCP server which sends updates out to clients every few minutes.
The vast majority of the time there are no issues on either side. However, recently every so often we've started seeing the following exceptions:
SerializationException: The input stream is not a valid binary format. The starting contents (in bytes) are: ...
SocketException (0x80004005): An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full
I am using Message Framing to send the size of the data, which I thought would prevent the first exception from happening.
I've no idea about the second exception. Appears to be completely random. It doesn't affect the server, only the client. After it appears the client that received the error stops receiving messages.
Any suggestions would be much appreciated.