Function openthread_sys::otTcpConnect

source ยท
pub unsafe extern "C" fn otTcpConnect(
    aEndpoint: *mut otTcpEndpoint,
    aSockName: *const otSockAddr,
    aFlags: u32,
) -> otError
Expand description

Records the remote host and port for this connection.

TCP Fast Open must be enabled or disabled using @p aFlags. If it is disabled, then the TCP connection establishment handshake is initiated immediately. If it is enabled, then this function merely records the the remote host and port, and the TCP connection establishment handshake only happens on the first call to otTcpSendByReference().

If TCP Fast Open is disabled, then the caller must wait for the otTcpEstablished callback indicating that TCP connection establishment handshake is done before it can start sending data e.g., by calling otTcpSendByReference().

@param[in] aEndpoint A pointer to the TCP endpoint structure to connect. @param[in] aSockName The IP address and port of the host to which to connect. @param[in] aFlags Flags specifying options for this operation (see enumeration above).

@retval OT_ERROR_NONE Successfully completed the operation. @retval OT_ERROR_FAILED Failed to complete the operation.