jchristn / WatsonWebsocket

A simple C# async websocket server and client for reliable transmission and receipt of data
MIT License
277 stars 53 forks source link

Websocket server suddenly interupted ( The remote party closed the Websocket connection without completing the closing handshake) #83

Closed ange-black69 closed 2 years ago

ange-black69 commented 2 years ago

Hello, We are facing a issue on our Game WebSocket server. After like 2 to 3 hours of activity the dotnet process stopped runing and thorwing that : The remote party closed the Websocket connection without completing the closing handshake.

Our code checks if they are connected before calling sendasync

Here is the stacktrace : pastebin

It happenend suddently.

EDIT :

After more research, it seems that broken pipe happen when we have a very bad client connection and server think client is disconnected so then send FIN packet but client continue to send data after (never received this FIN packet). As the server closed the connection already, it sends a RST packet, so broken pipe!

Is there a way for the library to handle it or expose a handler to catch this?

Thanks you

jchristn commented 2 years ago

Hi @ange-black69 sorry for the delay! Your stack trace doesn't show from which method in the library the exception is being thrown. Could you help with that? Thanks!