[Help-gnutls] gnutls_handshake and timeout

Nikos Mavrogiannopoulos nmav at gnutls.org
Wed May 4 23:20:01 CEST 2005


On Tuesday 03 May 2005 17:32, Regit wrote:
> Hi,
>
> I'm looking for the correct way to set a timeout to gnutls_handshake. I
> want to be able to say something like stop handshake after N seconds, so
> I will be able to free threads working on handshake.
> I don't want that a simple telnet on application port blocks the thread
> for an eternity.
Hello,
 The only reason gnutls_handshake() blocks are the recv() and probably send() 
calls. You can set a timeout on these calls with setsockopt(). In that case
gnutls_handshake() will return GNUTLS_E_AGAIN. Hope that helps.

> BR,

-- 
Nikos Mavrogiannopoulos





More information about the Gnutls-help mailing list