I have a proxy server written in C # that runs as a Windows service. It listens for 127.0.0.1:xxxxx, where xxxxx can be a port range from 53500 to.
The proxy works very well, but sometimes some ports stop responding, and when I try to connect to them, it says that the request was delayed or it did not respond.
I was not able to reproduce this problem in my development area, but I think this is due to something that causes BeginReceive not to be called after EndReceive. The following quote from a stream about the symptoms that I experience.
A similar problem occurs when using asynchronous communication, and there is a execution path that, as it turned out, does not call BeginReceive after the completion of the previous EndReceive. This makes the socket uninformed for all further data sent by the remote side.
Is there a way to simulate a situation where a port stops responding. I want to write some code to check if the port is responding before it goes with the request. If it does not respond, I can remove the listener on this port and add it again. This is a bandage to prevent the proxy server until I can determine the cause of the problem.
I also added some additional protocols to determine what causes the ports to stop responding.
source
share