[Help-gnutls] gnutls_handshake and timeout
nmav at gnutls.org
Wed May 4 23:20:01 CEST 2005
On Tuesday 03 May 2005 17:32, Regit wrote:
> 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.
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.
More information about the Gnutls-help