[Help-gnutls] Re: handshake with non-blocking sockets?

Daniel Stenberg daniel at haxx.se
Tue Mar 22 10:38:39 CET 2005

On Mon, 21 Mar 2005, Simon Josefsson wrote:

> http://article.gmane.org/gmane.comp.encryption.gpg.gnutls.devel/1267
> of any help?

Thanks. This helps me a bit but more for the non-blocking case with send/recv, 
which I haven't really gotten to yet. I don't see how this helps me for the 
handshake case.

> If I understand correctly, though, GnuTLS perform some internal buffering, 
> so calling select might not be reliable.  But I don't have much experience 
> with non-blocking I/O and GnuTLS.  Perhaps Nikos can chime in.  I'm not sure 
> how portable it is for GnuTLS to push data back into the OS buffers, which 
> would be one way to make select() work as expected.

It doesn't sound like the proper way to proceed.

In my simple-minded view, it would be better if there is a function we could 
use to ask gnutls if there is more data in its buffers or not (compare with 
SSL_pending() in OpenSSL) so that we then can call gnutls again without doing 
select() and only if gnutls can't do more we wait for more socket actions.

You may take this question as a request for some clarification in the docs on 
how gnutls behaves when using blocking vs non-blocking sockets.

          -=- Daniel Stenberg -=- http://daniel.haxx.se -=-
   ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`ol

More information about the Gnutls-help mailing list