Function esp_idf_svc::sys::esp_tls_conn_new_async

source ·
pub unsafe extern "C" fn esp_tls_conn_new_async(
    hostname: *const i8,
    hostlen: i32,
    port: i32,
    cfg: *const esp_tls_cfg,
    tls: *mut esp_tls,
) -> i32
Expand description

@brief Create a new non-blocking TLS/SSL connection

This function initiates a non-blocking TLS/SSL connection with the specified host, but due to its non-blocking nature, it doesn’t wait for the connection to get established.

@param[in] hostname Hostname of the host. @param[in] hostlen Length of hostname. @param[in] port Port number of the host. @param[in] cfg TLS configuration as esp_tls_cfg_t. non_block member of this structure should be set to be true. @param[in] tls pointer to esp-tls as esp-tls handle.

@return - -1 If connection establishment fails. - 0 If connection establishment is in progress. - 1 If connection establishment is successful.