Dan Kegel wrote:
>
> Dan Kegel wrote:
> > > > > Then you get what is available.
> > > >
> > > > Because you're not using a nonblocking socket, the read()
> > > > blocks until the number of requested bytes become available.
> > > >
> > > > You would "get what is available" only if you set the socket into
> > > > nonblocking mode.
> > >
> > > That is simply not true. The state machine sample would not work AT ALL
> > > if that were the case. But like I say, go ahead, make them non-blocking.
> > > Suits me.
> >
> > ? You're saying that, simply because select() said a file was readable,
> > that you can read 1024 bytes from it without blocking.
> >
> > I must be missing something.
>
> OK, I got it. Sorry for the line noise. read() does return early
> on partial reads even when not in nonblocking mode.
>
> I do still think Ben is trusting select a bit too much; real servers
> that must avoid blocking really do set sockets to nonblocking mode
> just in case.
How many times do I have to say "I agree"? I agree. Do it!
Cheers,
Ben.
--
http://www.apache-ssl.org/ben.html
"There is no limit to what a man can do or how far he can go if he
doesn't mind who gets the credit."
Robert Woodruff
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]