Blame doc/functions/gnutls_transport_set_pull_timeout_function

Packit aea12f
Packit aea12f
Packit aea12f
Packit aea12f
Packit aea12f
@deftypefun {void} {gnutls_transport_set_pull_timeout_function} (gnutls_session_t @var{session}, gnutls_pull_timeout_func @var{func})
Packit aea12f
@var{session}: is a @code{gnutls_session_t}  type.
Packit aea12f
Packit aea12f
@var{func}: a callback function
Packit aea12f
Packit aea12f
This is the function where you set a function for gnutls to know
Packit aea12f
whether data are ready to be received. It should wait for data a
Packit aea12f
given time frame in milliseconds. The callback should return 0 on 
Packit aea12f
timeout, a positive number if data can be received, and -1 on error.
Packit aea12f
You'll need to override this function if @code{select()}  is not suitable
Packit aea12f
for the provided transport calls.
Packit aea12f
Packit aea12f
As with @code{select()} , if the timeout value is zero the callback should return
Packit aea12f
zero if no data are immediately available. The special value
Packit aea12f
@code{GNUTLS_INDEFINITE_TIMEOUT}  indicates that the callback should wait indefinitely
Packit aea12f
for data.
Packit aea12f
Packit aea12f
 @code{gnutls_pull_timeout_func} is of the form,
Packit aea12f
int (*gnutls_pull_timeout_func)(gnutls_transport_ptr_t, unsigned int ms);
Packit aea12f
Packit aea12f
This callback is necessary when @code{gnutls_handshake_set_timeout()}  or 
Packit Service 991b93
@code{gnutls_record_set_timeout()}  are set, under TLS1.3 and for enforcing the DTLS
Packit Service 991b93
mode timeouts when in blocking mode.
Packit Service 991b93
Packit Service 991b93
For compatibility with future GnuTLS versions this callback must be set when
Packit Service 991b93
a custom pull function is registered. The callback will not be used when the
Packit Service 991b93
session is in TLS mode with non-blocking sockets. That is, when @code{GNUTLS_NONBLOCK} 
Packit Service 991b93
is specified for a TLS session in @code{gnutls_init()} .
Packit aea12f
Packit aea12f
The helper function @code{gnutls_system_recv_timeout()}  is provided to
Packit aea12f
simplify writing callbacks. 
Packit aea12f
Packit aea12f
@strong{Since:} 3.0
Packit aea12f
@end deftypefun