There's a really nice Doug Lea presentation on the scalable Java I / O that I followed when creating my server. I use the following approach:
In my "reactor" there is one input / output stream that performs only input / output operations (and very simple decoding / encoding); It simply translates between bytes and message objects, and then passes the incoming message objects to the thread pool to handle business logic. I would highly recommend this approach - If the I / O stream is not saturated, there is no need for more than one I / O stream , and I would suggest that most of the I / O bottlenecks are due to the fact that another processing place in this thread .
, - , " ", , , , . , , , SelectionKey.