Mark,

Mea culpa. The problem was actually that select() tells you the total descriptors ready in each of your fdsets for read, write and except.

So for a single descriptor ready for read and write you would get a count of 2.

Right I'm off to sit in the corner in quiet embarassment.

Cheers
Gerry

Quoting mark:


Hi Gerry,

I thought  that standard UNIX select() returns the actual number of FDs
ready?

Regards

Mark
--------------------------------------------------------------------------------------------------------------------------------|

Quoting "Roy T. Fielding" <[EMAIL PROTECTED]>:

On Jan 4, 2006, at 4:42 PM, [EMAIL PROTECTED] wrote:

Quoting Garrett Rooney <[EMAIL PROTECTED]>:

Um, I don't think that's going to work, rv is the number of
descriptors that hit, there's nothing that says that if N hit  it'll be
the first N...

That would be true were I comparing  I<RV but I'm comapring J<RV :D

-    for (i = 0; i < pollset->nelts; i++) {
+    for (i = 0; j < rv; i++) {

I have a vague recollection that there was some reason we couldn't
trust the return value being equal to the number of ready descriptors
on some platform, but I have no time to search the archives for why.
I may be remembering something related to ... er .. that other call
like poll... hmmm, oh, select.  Or maybe I just need more caffeine.

....Roy


You are correct, select() returns the total number of descriptors in
the FDSET rather than those which have had events.

However the patch applies specifically to the poll() implementation for
pollset, select() remains unchanged for that very reason.







This communication is for informational purposes only. It is not intended
as an offer or solicitation for the purchase or sale of any financial
instrument or as an official confirmation of any transaction. All market prices, data and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein
do not necessarily reflect those of JPMorgan Chase & Co., its subsidiaries
and affiliates




Reply via email to