0

I have a c# web application that calls an API, It was working fine until past two weeks since then it started failing with below error.

An existing connection was forcibly closed by the remote host

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host.

When I try the same code with c# console application, it is working fine without any errors.

Can anyone please let me know why am I getting the error?

R. Richards
  • 24,603
  • 10
  • 64
  • 64
vinisha9
  • 91
  • 1
  • 2
  • 8
  • Does your web api communicate using SSL or TLS? Is there a chance that the security protocol was upgraded? – panda Nov 30 '16 at 17:49
  • check this http://stackoverflow.com/questions/2087680/an-existing-connection-was-forcibly-closed-by-the-remote-host-in-wcf – MiguelSlv Dec 01 '16 at 00:35

1 Answers1

0

This problem can be fixed if you increase the corespond binding attribute elements both on client and server sides. I looked into the issue and it seems to be the most relevant suggestion to fix this.

Here are some good forums where this problem is discussed in more detail.

https://social.msdn.microsoft.com/Forums/vstudio/en-US/7b43e645-02f7-4cec-b669-55867c9bb56c/systemnetsocketssocketexception-an-existing-connection-was-forcibly-closed-by-the-remote-host?forum=wcf

https://forums.asp.net/t/1517757.aspx?WCF+issues+sending+large+data+An+existing+connection+was+forcibly+closed+by+the+remote+host+

därko
  • 19
  • 9