[gnutls-help] DTLS and retransmission and reordering

Nikos Mavrogiannopoulos nmav at gnutls.org
Wed Apr 10 22:20:23 CEST 2013

On 04/10/2013 06:07 PM, Joke de Buhr wrote:

> yes i'm using the non-blocking mode. for client and server sesssion.
>   gnutls_init(&session_, GNUTLS_DATAGRAM | GNUTLS_NONBLOCK | ...);
> here is a stack trace where the pull function is called:
> #0 _gnutls_io_check_recv() at /lib/gnutls_buffers.c:677
> #1 _dtls_wait_and_retransmit() at /lib/gnutls_dtls.c:414
> #2 _gnutls_recv_handshake_final() at /lib/gnutls_handshake.c:2883
> #3 _gnutls_handshake_client() at /lib/gnutls_handshake.c:2730
> #4 gnutls_handshake() at /lib/gnutls_handshake.c:2450
> #5 session<server::gateway<server::server<boost::asio::ip::udp> > 
>> ::handshake() at /home/joke/Projects/vpn/src/session.t++:175
> the pull timeout function returns GNUTLS_E_AGAIN.
> but _dtls_retransmit is called only if the return value was GNUTLS_E_TIMEDOUT.

That's pretty correct. _gnutls_io_check_recv() returns
GNUTLS_E_TIMEDOUT, zero or fatal error values.

Your pull timeout function should return 0 on timeout, a positive number
if data can be received and -1 on error. I'll make the documentation
more clear on that, but in your case you should have returned zero
instead of EAGAIN.


More information about the Gnutls-help mailing list