Java NIO: calling selector.select() before socketChannel.write()

Sergey Marakhov <[email protected]> Tue, 15 Apr 2008 19:27:04 -0400
Newsgroups gmane.comp.windows.devel.java.advanced
Message-ID <LISTSERV%[email protected]>
Hi all.

I=92m looking at ways to simplify our current implementation of socket
communications between an agent and multiple clients. There is a client
connection object created per connected client, client connection is
passed through an =93incoming" selector and each client connection opens its=

own outgoing selector. So, question 1: do I need to create separate
outgoing selectors, or is using a single selector for both in and out
operations is the way to go?

Next, before each invocation of socketChannel.write(=85) method, we do
outgoingSelector.select(). Is it necessary to do select() before write
operations?

Our knowledge of NIO is rather limited, hence all this questions.

Much appreciated=85
Sergey

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
This list is hosted by DevelopMentor=AE  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com