Add stopping mechanics. Still throws an exception on socket close. Needs to use ServerSocketChannel in future.