Background:
- C # .net synchronous tcp server
- The TcpClient object is assigned a lock on the TcpListener using the AcceptTcpClient method
- as soon as there is a TcpClient object, I pass it to a thread that calls the GetStream client method to create a NetworkStream
- this NetworkStream is looped, networkStream.Read is executed at each iteration (someBuffer, 0, 4096)
- right now the client and server are located on the same network, without any overloads talk about
- My server has a lot of memory to save
- if I download my server software to another computer, the problem disappears
- kicker: traffic from the network. Linux box goes through fine and on time.
My server has been working very well for several months. However, over the past weekend, instead of quickly getting small groups of bytes, the place where the process begins (tcpListener.AcceptTcpClient ()) occurs only every two minutes. Thus, my server sits idle, and then receives 30-50 client requests included in one huge block of bytes. Needless to say, this leads to a huge delay and load on my server. If the number of client requests is large enough, it may take 30 minutes to your server.
Upon entering my clients, I see that they are making network recordings and joining between them. Thus, customers are working correctly.
This repeats some kind of systemic intervention. Is my Tcp server (as described above) bad or is something on Windows interfering with my traffic and how can I tell?
Thanks guys.