lets_code_javascript icon indicating copy to clipboard operation
lets_code_javascript copied to clipboard

RTS stop 3

Open aquamoth opened this issue 7 years ago • 0 comments

I suggest rewriting the cleanup logic to ask RealTimeServer to disconnect all open sockets before stopping the http server.

This code is still somewhat a hack, because I don't quite understand why I need some setTimeout() wrappers around done, but I still think this is a lot better. Also the private variable RealTimeServer._disconnectAllCallback can be debated, but doing it like this we can keep numberOfActiveConnections() as a private method without explicit testing.

This is my preferred PR of 3 to improve the shutdown logic.

aquamoth avatar May 21 '17 10:05 aquamoth