openHiTLS API openHiTLS 0.1.0-Alpha1

◆ HITLS_Connect()

int32_t HITLS_Connect ( HITLS_Ctx ctx)

The client starts the handshake with the TLS server.

Starting the handshake with the TLS server using HITLS_Connect. The UIO object must be created and bound to the HiTLS context. HITLS_Connect is designed as a non-blocking interface. If the handshake cannot be continued, the returned value will not be HITLS_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_Connect. Note that if UIO is blocked, HITLS_Connect will also block, but the return value is processed in the same way.

注意
Only clients can call this interface.
参数
ctx[IN] TLS connection handle.
返回值
HITLS_SUCCESS
HITLS_REC_NORMAL_RECV_BUF_EMPTY,recordThe receiving buffer is NULL and the handshake can be continued.
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.