Debian Codegraph @

doc/functions/gnutls_record_recv

raw
1
2
3
4
5 @deftypefun {ssize_t} {gnutls_record_recv} (gnutls_session_t @var{session}, void * @var{data}, size_t @var{data_size})
6 @var{session}: is a @code{gnutls_session_t} type.
7
8 @var{data}: the buffer that the data will be read into
9
10 @var{data_size}: the number of requested bytes
11
12 This function has the similar semantics with @code{recv()} . The only
13 difference is that it accepts a GnuTLS session, and uses different
14 error codes.
15 In the special case that the peer requests a renegotiation, the
16 caller will receive an error code of @code{GNUTLS_E_REHANDSHAKE} . In case
17 of a client, this message may be simply ignored, replied with an alert
18 @code{GNUTLS_A_NO_RENEGOTIATION} , or replied with a new handshake,
19 depending on the client's will. A server receiving this error code
20 can only initiate a new handshake or terminate the session.
21
22 If @code{EINTR} is returned by the internal pull function (the default
23 is @code{recv()} ) then @code{GNUTLS_E_INTERRUPTED} will be returned. If
24 @code{GNUTLS_E_INTERRUPTED} or @code{GNUTLS_E_AGAIN} is returned, you must
25 call this function again to get the data. See also
26 @code{gnutls_record_get_direction()} .
27
28 @strong{Returns:} The number of bytes received and zero on EOF (for stream
29 connections). A negative error code is returned in case of an error.
30 The number of bytes received might be less than the requested @code{data_size} .
31 @end deftypefun