davidfowl / BedrockFramework

High performance, low level networking APIs for building custom servers and clients.
MIT License
1.07k stars 155 forks source link

Server Start-Stop "restart" exception #147

Open tothalexlaszlo opened 2 years ago

tothalexlaszlo commented 2 years ago

Scenario:

  1. Start server
  2. Stop server
  3. Start server
  4. Stop server <- at this point a TimerAwaitable is already disposed in the server component If we remove readonly keyword from _timerAwaitable and move its initialization from ctor to StartAsync() we could start-stop the server as many times as we want without throwing any exception.

Shall I PR it or it is intentionally done?

davidfowl commented 2 years ago

Yes please, send the fix.