File: gnutls_transport_set_pull_timeout_function

package info (click to toggle)
gnutls28 3.8.9-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 83,872 kB
  • sloc: ansic: 388,071; asm: 117,804; sh: 18,477; makefile: 6,732; yacc: 1,858; python: 1,399; cpp: 1,243; perl: 995; sed: 16
file content (38 lines) | stat: -rw-r--r-- 1,599 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38




@deftypefun {void} {gnutls_transport_set_pull_timeout_function} (gnutls_session_t @var{session}, gnutls_pull_timeout_func @var{func})
@var{session}: is a @code{gnutls_session_t}  type.

@var{func}: a callback function

This is the function where you set a function for gnutls to know
whether data are ready to be received. It should wait for data a
given time frame in milliseconds. The callback should return 0 on 
timeout, a positive number if data can be received, and -1 on error.
You'll need to override this function if @code{select()}  is not suitable
for the provided transport calls.

As with @code{select()} , if the timeout value is zero the callback should return
zero if no data are immediately available. The special value
@code{GNUTLS_INDEFINITE_TIMEOUT}  indicates that the callback should wait indefinitely
for data.

 @code{gnutls_pull_timeout_func} is of the form,
int (*gnutls_pull_timeout_func)(gnutls_transport_ptr_t, unsigned int ms);

This callback is necessary when @code{gnutls_handshake_set_timeout()}  or 
@code{gnutls_record_set_timeout()}  are set, under TLS1.3 and for enforcing the DTLS
mode timeouts when in blocking mode.

For compatibility with future GnuTLS versions this callback must be set when
a custom pull function is registered. The callback will not be used when the
session is in TLS mode with non-blocking sockets. That is, when @code{GNUTLS_NONBLOCK} 
is specified for a TLS session in @code{gnutls_init()} .

The helper function @code{gnutls_system_recv_timeout()}  is provided to
simplify writing callbacks. 

@strong{Since:} 3.0
@end deftypefun