there can be more than one message on the socket; empty the queue when shutting down...