Server now finally accepts repeated connections, and is shut down with ctrl-c using signal handling.