disconnecting sockets on quit, handling SIGTERM event