Add a stop function to the server. When ctrl+c the server, it now disconnect clietn gracefully.