[Help-gnutls] passing SSL connection to another process

Timo Sirainen tss at iki.fi
Thu Aug 15 06:45:01 CEST 2002

On Thu, Aug 15, 2002 at 12:36:15PM +0300, Nikos Mavroyanopoulos wrote:
> > Another thing that isn't quite clear from the documentation is how to use
> > gnutls with nonblocking I/O. All functions returning GNUTLS_E_AGAIN should
> > be called again, but I'd also need to know if it happened on read or write,
> > so I could call it again at proper time. I think this is a problem only with
> > gnutls_handshake()?
> I don't understand the question.

Basically: How do I create a poll() based process handling multiple SSL

If I've understood everything right, there's 3 functions that may block if
socket is in blocking mode: gnutls_record_recv(), gnutls_record_send() and

With nonblocking sockets, if gnutls_record_recv() doesn't read a full
packet, GNUTLS_E_AGAIN is returned. So I know it wants more data, and I call
it again once poll() says there's more data. The same goes for

But what about gnutls_handshake(), AFAIK it both receives data and sends
data. How should I know when to call it again? I'd want something similiar
to gnutls_record_check_pending() to tell me if handshake waits on input or

More information about the Gnutls-help mailing list