PR_Poll() and non-blocking sockets?

Matt Lawson <[email protected]>
Newsgroups gmane.comp.mozilla.devel.nspr
Message-ID <[email protected]>
Hi,

I am attempting to use PR_Poll() in a server application to poll a collection of non-blocking sockets (which have been accepted using PR_Accept())  The problem is, no matter what I do, the call to PR_Poll() always returns immediately indicating the socket is readable.

Is this the normal behavior?  Will PR_Poll() never pause for any length of time with non-blocking sockets?  I don't want to be hogging CPU at 100% if it's not necessary.

I have searched for solutions online.  I have already been through the exercise of calling PR_GetConnectStatus() and PR_Poll() with write|exception to ensure that the socket gets fully established (and in fact this was part of the problem)

So now I have an incoming PR_Accept()ed socket, which PR_GetConnectStatus() says is good, and I PR_Poll() it (with PR_POLL_READ) and it always returns true.

This is all from the server's point of view.  All sockets including the bind/listen sockets are non-blocking.

Am I missing a step?  or is this normal?

Thanks.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.