L
L
LiptonOlolo2021-05-27 21:23:57
ASP.NET
LiptonOlolo, 2021-05-27 21:23:57

SignalR Core client crashes, what's the problem?

Good day.
The client sent logs of a program that runs on SignalR (.net 5) with the question "Why does it sometimes crash?"
Log:


System.Net.WebSockets.WebSocketException (0x80004005): The remote party closed the WebSocket connection without completing the close handshake.
---> System.IO.IOException: Unable to read data from the transport connection: A program on your host machine terminated an established connection.
---> System.Net.Sockets.SocketException (10053): A program on your host machine computer terminated the established connection.
--- End of inner exception stack trace ---
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.GetResult(Int16 token)
at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](TIOAdapter adapter, Memory`1 buffer) at System.Net.Http.HttpConnection.ReadBufferedAsyncCore
(Memory`1 destination)
(Memory`1 buffer, CancellationToken cancellationToken)
at System.Net.WebSockets.ManagedWebSocket.EnsureBufferContainsAsync(Int32 minimumRequiredBytes, CancellationToken cancellationToken, Boolean throwOnPrematureClosure)
at System.Net.WebSockets.ManagedWebSocket.ReceiveAsyncPrivate[TWebSocketReceiveResultGetter,TWebSocketReceiveResult](Memory`1 payloadBuffer, CancellationToken (cancellationToken, TWebSocketReceiveResultGetter resultGetter)
at System.Net.WebSockets.ManagedWebSocket.ReceiveAsyncPrivate[TWebSocketReceiveResultGetter,TWebSocketReceiveResult](Memory`1 payloadBuffer, CancellationToken cancellationToken, TWebSocketReceiveResultGetter resultGetter)
at Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport.StartReceiving(WebSocket socket)
at System. IO.Pipelines.PipeCompletion.ThrowLatchedException()
at System.IO.Pipelines.Pipe.GetReadResult(ReadResult& result)
at System.IO.Pipelines.Pipe.GetReadAsyncResult()
at Microsoft.AspNetCore.SignalR.Client.HubConnection.ReceiveLoop(ConnectionState connectionState )


This is the first time I've seen this error, I've never seen it before.
The error puts the whole program at once (it just closes).
What could be the problem?
I, during development, had no problems with Signal, connections never fell.

Ps - There is no antivirus on the computer, the data is chasing over the local network, there is not much data at all. I sin that the client has problems with the local network and / or the computer hosting the signalr server.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Bannikov, 2021-05-27
@vabka

The error puts the whole program at once (it just closes).

You don't catch the exception.
I, during development, had no problems with Signal, connections never fell.

This means that the client does not have an ideal Internet, and you probably tested it on a localhost.
Or the network on the server is buggy. Mb still the client could get on restart of the server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question