Women in Technology

Hear us Roar



Article:
  Top Ten New Things You Can Do with NIO
Subject:   non-blocking and select
Date:   2002-10-10 09:39:56
From:   anonymous2
Thanks for an excellant article. You accurately seperate non-blocking from multiplexing, which previous articles on NIO have not done.


Question: Why does select require the sockets to be non-blocking? This is different from the standard BSD Sockets API and likely to cause confusion with those (and there are many) of us who are familiar with the BSD Sockets API.


Pete Flugstad

Full Threads Oldest First

Showing messages 1 through 1 of 1.

  • Ron Hitchens photo non-blocking and select
    2002-10-15 14:37:34  Ron Hitchens | O'Reilly Author [View]

    Re: why channels must be non-blocking to be used with a Selector. Here's a direct quote from a member of the NIO Expert Group:


    <blockquote>

    "This was explicitly discussed, and we were of two minds. The winning idea in the end was that allowing use of Selector with blocking sockets was error-prone -- reusing a big body of blocking I/O code with Selector is likely to break subtly somehow. I'd be hard pressed to say exactly how, but that was our best judgement."

    </blockquote>