Add a stop method in NIO server