Background:
- C# .net synchronous Tcp server
- a TcpClient object is assigned by blocking on a TcpListener with the AcceptTcpClient method
- once there's a TcpClient object, I pass it to a thread that invokes the client's GetStream method to create a NetworkStream
- this NetworkStream is looped over, in each iteration doing a networkStream.Read(someBuffer, 0, 4096)
- right now client and server are located on the same network, with no congestion to speak of
- my server has plenty of memory to spare
- if I load my server software onto another machine, the problem goes away
- the kicker: traffic from a network Linux box gets through fine and on time
My server has been functioning just fine for several months. However, over the past weekend instead of receiving small groups of bytes in quick succession, the place where the process begins ( tcpListener.AcceptTcpClient() ) only occurs every couple of minutes. So my server sits idle, then gets 30-50 client requests all bundled into one huge block of bytes. Needless to say this causes a huge delay and put strain on my server. If the clump of client requests is big enough, it can take my server 30 minutes to catch up.
In logging built into my clients, I can see them do network writes, and flush between each one. So the clients are functioning correctly.
This reaks of some kind of system intervention. Is my Tcp server (as describe above) bad, or is something in Windows interfering with my traffic, and how can I tell?
Thanks guys.