0

My SignalR server (ASP.NET) and client (ASP.NET) both are working fine as excepted but multiple times on a daily basis, I'm getting the following two errors at the end of the SignalR client (ASP.NET):

System.Net.Sockets.SocketException (0x80004005): An existing connection was forcibly closed by the remote host

System.Net.WebException: The request was aborted: The connection was closed unexpectedly.

I've looked in the following ways but still unable to find out the root cause

  1. Check High CPU usage when the error occurred.
  2. Tried to send lots of data to the Server but received all the data received successfully at the Client through the Server.
  3. Checked server is not creating unnecessary connections. Only max three connections are there.
Peter Csala
  • 17,736
  • 16
  • 35
  • 75
  • Socket works in connected environment, so if there is a fluctuation in network may disconnect the socket and you may get this error. As you have not provided weather you are reconnecting it or not [here is a link](https://stackoverflow.com/questions/23375043/best-practice-for-reconnecting-signalr-2-0-net-client-to-server-hub) will help you. – शेखर Jun 14 '21 at 05:22
  • @शेखर The client is connecting with the server by two way. Once when the client is started and also when there is a connection closed event raised at client side. – Ajay Sharma Jun 14 '21 at 05:43
  • If you can't produce a minimal reproducible code sample (You aren't providing code at all actually) as well as the scenario, then this question can't receive any reasonable or factual answers. I will say.. I recall there is a known issue/bug written up in SignalR github that could relate to this. As there was at least one specification aspect not being implemented in SignalR, and that support/feature/issue is not intended to be worked on last time I checked. (relates to expected httpresponse status codes differing, if I recall) what client were/are you observing this on? – Brett Caswell Jun 14 '21 at 05:44
  • also, are you using cancellation tokens in your server-side hub implementation? (again, we'll need code to actually determine on here) – Brett Caswell Jun 14 '21 at 05:56

0 Answers0