UNIX select() equivalent in Java for polling multiple sockets

  • Thread starter captain_oldfield
  • Start date
C

captain_oldfield

Hi All,

I am struggling to find any information on how Java can be made to
poll multiple sockets in a single thread. In variants of UNIX this is
simply done via the select() call.

Can anyone provide any links to tutorials/information explaining how
this is done? I did come across information on the SocketChannel &
Selector classes somewhere, but unfortunately I lost the link :( I do
remember there was something particular about version 1.4 &
onwards....

Thanks all
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

captain_oldfield said:
I am struggling to find any information on how Java can be made to
poll multiple sockets in a single thread. In variants of UNIX this is
simply done via the select() call.

Can anyone provide any links to tutorials/information explaining how
this is done? I did come across information on the SocketChannel &
Selector classes somewhere, but unfortunately I lost the link :( I do
remember there was something particular about version 1.4 &
onwards....

They keyword is nio.

There are lots of hits on Google. Including:

http://www.owlmountain.com/tutorials/NonBlockingIo.htm
http://rox-xmlrpc.sourceforge.net/niotut/index.html
http://java.sun.com/j2se/1.5.0/docs/guide/nio/example/index.html
http://www.ibm.com/developerworks/java/library/j-javaio/

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top