log information about uncaught exceptions.
ignore 'not connected' exception when shutting down socket