an existing connection was forcibly closed by the remote host

  • Thread starter Thread starter figelwump
  • Start date Start date
F

figelwump

Hello,

I am developing an HTTP/1.1 proxy server in c#.net. I am encountering
the following exception when I try to send the response body back to
the client: "An existing connection was forcibly closed by the remote
host". This exception is thrown by the Socket.Send() method (where the
specific socket in this case is the client socket).

Additionally, if I do not send the response headers back to the client,
I do not get this error when sending the response body.

Any ideas/pointers on this issue?

Thanks,
Vishal
 
Thanks for the pointer. I also suspected that the issue was related to
the headers, so I did try removing the the Connection: close header
from the response. This did not change the exception. Also I am not
setting the Connection header in the request I pass to the server.
 
Back
Top