pub type otTcpDisconnected = Option<unsafe extern "C" fn(aEndpoint: *mut otTcpEndpoint, aReason: otTcpDisconnectedReason)>;
Expand description

This callback indicates that the connection was broken and should no longer be used, or that a connection has entered the TIME-WAIT state.

It can occur if a connection establishment attempt (initiated by calling otTcpConnect()) fails, or any point thereafter (e.g., if the connection times out or an RST segment is received from the connection peer). Once this callback fires, all resources that the application provided for this connection (i.e., any otLinkedBuffers and memory they reference, but not the TCP endpoint itself or space for the receive buffers) can be reclaimed. In the case of a connection entering the TIME-WAIT state, this callback is called twice, once upon entry into the TIME-WAIT state (with OT_TCP_DISCONNECTED_REASON_TIME_WAIT, and again when the TIME-WAIT state expires (with OT_TCP_DISCONNECTED_REASON_NORMAL).

@param[in] aEndpoint The TCP endpoint whose connection has been lost. @param[in] aReason The reason why the connection was lost.

Aliased Type§

enum otTcpDisconnected {
    None,
    Some(unsafe extern "C" fn(_: *mut otTcpEndpoint, _: u32)),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some(unsafe extern "C" fn(_: *mut otTcpEndpoint, _: u32))

Some value of type T.