- added functionality to close all open sockets when shutting down