UNIX select() equivalent in Java for polling multiple sockets

Discussion in 'Java' started by captain_oldfield, Oct 4, 2007.

  1. 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
    captain_oldfield, Oct 4, 2007
    #1
    1. Advertising

  2. captain_oldfield wrote:
    >
    > 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
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=, Oct 4, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stuart Clayman

    Java and Unix Domain sockets

    Stuart Clayman, Jul 10, 2003, in forum: Java
    Replies:
    2
    Views:
    921
    Marc Rochkind
    Jul 10, 2003
  2. 2xzero
    Replies:
    1
    Views:
    375
    zn├┤rt
    Feb 16, 2004
  3. Chris Markle
    Replies:
    0
    Views:
    4,996
    Chris Markle
    Apr 24, 2004
  4. napi
    Replies:
    3
    Views:
    839
  5. palmiere
    Replies:
    1
    Views:
    396
    Erwin Moller
    Feb 9, 2004
Loading...

Share This Page