Blocking modeA selectable channel is either in blocking mode or in non-blocking mode. In blocking mode, every I/O operation invoked upon the channel will block until it completes. In non-blocking mode an I/O operation will never block and may transfer fewer bytes than were requested or possibly no bytes at all. The blocking mode of a selectable channel may be determined by invoking its isBlocking method.

Which highlights a different thing you should take care of familiarise yourself with the concept of a channel and other things that surround nio, these are a bit awkward. But absolutely make sense in making the stuff happen which we want to make happen. I'm sorry if that last sentence sounds a little 'un-graspable', this is because the why behind things that NIO enables you to do, is hard to grasp depending on your background. Have I lost you yet? Either way there are book and blogs which explain this a lot better then me. http://java.sun.com/j2se/1.4.2/docs/guide/nio/http://www.pdf-search-engine.com/java-nio-pdf.html

And then you need a selector.select() loop retrieve the available keys and call stuff like key.isAcceptable() after which you can do something like:SocketChannel newChannel = server.accept();and then you have to choose a selector strategy for actual handing connections (handle everything using one selector, use slave selectors and distribute that among threads as you see fit.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org