[][src]Function xaynet::sdk::api::drop_client

#[no_mangle]pub unsafe extern "C" fn drop_client(
    client: *mut FFIClient,
    timeout: c_ulonglong
)

Stops and destroys a Client and frees its allocated memory.

Tries to gracefully stop the client for timeout seconds by blocking the current thread before shutting it down forcefully (outstanding tasks are potentially leaked in case of an elapsed timeout). Usually, no timeout (i.e. 0 seconds) suffices, but stopping might take indefinitely if the client performs long blocking tasks.

Errors

Ignores null pointer clients and returns immediately.

Safety

The method dereferences from the raw pointer arguments. Therefore, the behavior of the method is undefined if the arguments don't point to valid objects.