Working version of NIO server