openHiTLS API openHiTLS 0.1.0-Alpha1

◆ HITLS_SetShutdownState()

int32_t HITLS_SetShutdownState ( HITLS_Ctx ctx,
uint32_t  mode 
)

Set the shutdown status of the TLS link.

In HITLS_Close, if the peer end is not closed, a closed notification message is sent to the peer end. When the local end sends a closed notify message, the HiTLS sets the HITLS_SENT_SHUTDOWN flag bit. When the local end receives the closed notify message, the HiTLS sets the HITLS_RECEIVED_SHUTDOWN flag bit. By default, the HiTLS needs to send and receive closed notifications. The actual condition for properly closing a session is HITLS_SENT_SHUTDOWN. (According to the TLS RFC, it is acceptable to send only close_notify alerts without waiting for a reply from the peer.) If HITLS_RECEIVED_SHUTDOWN is set, it indicates that the peer end does not need to wait for the closed notification.

参数
ctx[IN] TLS connection handle.
mode[IN] TLS shutdown status: HITLS_SENT_SHUTDOWN / HITLS_RECEIVED_SHUTDOWN.
返回值
HITLS_SUCCESS,ifsuccessful.
Forother error codes, see hitls_error.h.