statianzo / Fleck

C# Websocket Implementation
MIT License
2.28k stars 583 forks source link

Disposing the server when RestartAfterListenError is true may result in a restarted socket #325

Open mathieuvanloon opened 2 years ago

mathieuvanloon commented 2 years ago

We recently had an issue where shutting down the Fleck server (with Dispose()) did not succeed. In fact the socket restarted itself. It turned out to be caused by this code:

image

since RestartAfterListenError was true, when one of the open connection triggered an exception the server was automatically restarted. So for now we'll set RestartAfterListenError to false when shutting down.