fixed S_SHUTDOWN handling code by calling stop from the main thread. The client-side message is printed twice though :D