Server now closes socket if client is terminated