Help Needed to Implement Streams in NIO
3 answers
Why use so many streams when you make it all easier with a selector and a single stream? If you want to take a multi-threaded approach to network I / O, you should consider plain old blocking sockets.
By the way, you can do everything with three selectors: one accepts connections, one reads, and one writes. When you accept a connection, you can register a channel with two other selectors with matching interests.
Of course, when you have to free a channel, you must deselect the SelectionKey from both selectors (read and write), or close it.
+1
a source to share
I would recommend Apache Mina to you : very flexible, high level abstraction, high performance, etc.
0
a source to share