mbedtls_net_recv_timeout() function
Read at most 'len' characters, blocking for at most 'timeout' seconds. If no error occurs, the actual amount read is returned.
Syntax
int mbedtls_net_recv_timeout( void *ctx,
unsigned char *buf,
size_t len,
uint32_t timeout );
Arguments
buf
The buffer to write to
len
Maximum length of the buffer
timeout
Maximum number of milliseconds to wait for data 0 means no timeout (wait forever)
Return value
the number of bytes received, or a non-zero error code: MBEDTLS_ERR_SSL_TIMEOUT if the operation timed out, MBEDTLS_ERR_SSL_WANT_READ if interrupted by a signal.
Notes
This function will block (until data becomes available or timeout is reached) even if the socket is set to non-blocking. Handling timeouts with non-blocking reads requires a different strategy.
![]()
int mbedtls_net_recv_timeout( void *ctx, unsigned char *buf, size_t len,
mbedtls_net_recv_timeout() calls 1 function:
![]()
mbedtls_net_recv_timeout()
mbedtls_net_recv_timeout():
![]()
mbedtls_net_recv_timeout()