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

Bob Lee <[email protected]> Tue, 15 Apr 2008 16:48:50 -0700
Newsgroups gmane.comp.windows.devel.java.advanced
Message-ID <[email protected]>
I've never used Java's non-blocking I/O, but in POSIX non-blocking I/O, you
typically use one select() for everything.

Bob

On Tue, Apr 15, 2008 at 4:27 PM, Sergey Marakhov <[email protected]=
>
wrote:

> Hi all.
>
> I'm 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 "incoming" selector and each client connection opens it=
s
> 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(R)  http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>

=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