signal handlers are added to clean sockets on close