Added code to delete and clean up sockets when they are closed
Added code to send a msg to all attached sockets