>
> Where do you want to add that? Ben tested that and it was too 
> expensive. AFAIK doing the FIONREAD would be useless if the socket is 
> not readable, and you don't know that because that's the whole point 
> of uv_read: "I want to read X data, give it to me when available". 


You are right.

I have actually tested it being faster with when the connection is fully 
saturated. ioctl(FIONREAD) returns 6 times the value of 64k and that made 
it faster then the 64k suggestion.

But now that I think about it: if we just provide a buffer that big without 
FIONREAD then we should be even faster.

Only reason why one would use FIONREAD is to create buffers of the exact 
size. But creating just a big buffer for the entire loop and then copying 
the from it into appropriate sized buffers should be faster anyway2.

Yeah, I'm convinced that ioctl(FIONREAD) is useless and in your proposed 
API doesn't even make sense.

-- 
You received this message because you are subscribed to the Google Groups 
"libuv" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/libuv.
For more options, visit https://groups.google.com/d/optout.

Reply via email to