openHiTLS API openHiTLS 0.1.0-Alpha1

◆ HITLS_Accept()

int32_t HITLS_Accept ( HITLS_Ctx ctx)

The server waits for the client to start handshake.

The server waits for the client to initiate the handshake. The UIO object must be created and bound to the HiTLS context.
HITLS_Accept is designed for non-blocking interfaces. If the handshake cannot be continued, the system returns. The return value is not success. If the return value is HITLS_REC_NORMAL_RECV_BUF_EMPTY or HITLS_REC_NORMAL_IO_BUSY, no fatal error occurs. Problems such as network congestion or network delay may occur. You can continue to call HITLS_Accept. Note that if the UIO is blocked, the HITLS_Accept will also be blocked, but the processing of the returned value is the same.

Attention
Only the server calls this API.
Parameters
ctx[IN] TLS connection handle.
Return values
HITLS_SUCCESS,thehandshake is successful.
HITLS_REC_NORMAL_RECV_BUF_EMPTY,recordThe receiving buffer is NULL and the handshake can continue.
HITLS_REC_NORMAL_IO_BUSY,thenetwork I/O is busy and needs to wait for the next sending. You can continue the handshake.
Forother error codes, see hitls_error.h.