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.

- Dan
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to