Small changes to provide a function call for the main thread to wait until the server stops (listen thread joins) before continuing.
Handly to call this in the main.cpp so that the end-user doesn't need to know that they're waiting for that thread in particular.