NIO-based networking framework for building protocol servers