Function SCNetworkConnectionStop

Source
pub unsafe extern "C-unwind" fn SCNetworkConnectionStop(
    connection: &SCNetworkConnection,
    force_disconnect: bool,
) -> bool
Available on crate feature SCNetworkConnection only.
Expand description

Stops the connection for the SCNetworkConnection. The disconnection process is asynchronous and the function will return immediately. The connection status can be obtained by polling or by callback. This function performs an arbitrated stop of the connection. If several applications have marked their interest in the connection, by calling SCNetworkConnectionStart, the call will succeed but the actual connection will be maintained until the last interested application calls SCNetworkConnectionStop.

In certain cases, you might want to stop the connection anyway. In these cases, you set the forceDisconnect argument to TRUE.

Parameter connection: The SCNetworkConnection to stop.

Returns: Returns TRUE if the disconnection request succeeded; FALSE if the disconnection request failed. The error must be retrieved from the SCError function.