Sorry, this video is for subscribers only.

Click here to subscribe!

Racing to Disconnect

Our Socket.IO abstraction connects cleanly. Now we need to make sure it disconnects as well. This is trickier than it sounds due to a race condition between our client and server: sometimes the client says it’s disconnected, but the server hasn’t finished disconnecting yet. How can we test this without using a slow and fragile timeout?

comments powered by Disqus