Operation was attempted on a nonexistent network connection error

Viewed 69

In my C# SignalR project, Facing the internal socket error during the hubconnection dispose and sometimes the code wont run, showing the exception provided below and also after the first execution , will be running fine for sometime. Is there anything that need to be done along with the hubconnection disposal or how the hubconnection disposal can be achieved properly so that this problem won't be recurring?

System.AggregateException: One or more errors occurred.

System.Net.Http.HttpRequestException: An error occurred while sending the request.

System.Net.WebException: Unable to connect to the remote server

System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it.

Stack Trace:

Socket.InternalEndConnect(IAsyncResult asyncResult)
Socket.EndConnect(IAsyncResult asyncResult)
ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
--- End of inner exception stack trace ---
HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
HttpClientHandler.GetResponseCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
Task.Wait()

0 Answers
Related