doghappy / socket.io-client-csharp

socket.io-client implemention for .NET
MIT License
729 stars 125 forks source link

Unhandle Exception on Latest Lib 3.0.3 #228

Open ankur4747github opened 2 years ago

ankur4747github commented 2 years ago

CoreCLR Version: 4.700.21.26205 .NET Core Version: 3.1.16 Description: The process was terminated due to an unhandled exception. Exception Info: System.Threading.Tasks.TaskCanceledException: The operation was canceled. at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken) at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.WebSockets.WebSocketHandle.ConnectAsyncCore(Uri uri, CancellationToken cancellationToken, ClientWebSocketOptions options) at System.Net.WebSockets.ClientWebSocket.ConnectAsyncCore(Uri uri, CancellationToken cancellationToken) at SocketIOClient.Transport.DefaultClientWebSocket.ConnectAsync(Uri uri, CancellationToken cancellationToken) at SocketIOClient.Transport.WebSocketTransport.ConnectAsync(Uri uri) at SocketIOClient.Transport.TransportRouter.ConnectByWebsocketAsync() at SocketIOClient.Transport.TransportRouter.ConnectAsync() at SocketIOClient.SocketIO.ConnectAsync() at SocketIOClient.SocketIO.ConnectAsync() at SocketIOClient.SocketIO.InvokeDisconnect(String reason) at System.Threading.Tasks.Task.<>c.b__139_1(Object state) at System.Threading.QueueUserWorkItemCallback.<>c.<.cctor>b__6_0(QueueUserWorkItemCallback quwi) at System.Threading.ExecutionContext.RunForThreadPoolUnsafe[TState](ExecutionContext executionContext, Action`1 callback, TState& state) at System.Threading.QueueUserWorkItemCallback.Execute() at System.Threading.ThreadPoolWorkQueue.Dispatch()

doghappy commented 2 years ago

It looks like an error occurred when connecting to the websocket server. Can you use fiddler to monitor the response of the websocket?

ankur4747github commented 2 years ago

it's not reproducible.. is there a way that you handle this error in your lib and handle it internally ?... because of this error my application crashed... I already using try-catch but still, my application crashed .. need a solution for the application that crashed..

ankur4747github commented 2 years ago

After SOCKET DIS-CONNECT= transport close my application crashed

doghappy commented 2 years ago

Please show stack info