close


Description:

public bool close (Cancellable? cancellable = null) throws Error

Close the DTLS connection.

This is equivalent to calling shutdown to shut down both sides of the connection.

Closing a DtlsConnection waits for all buffered but untransmitted data to be sent before it completes. It then sends a `close_notify` DTLS alert to the peer and may wait for a `close_notify` to be received from the peer. It does not close the underlying base_socket; that must be closed separately.

Once this is closed, all other operations will return g_io_error_closed. Closing a DtlsConnection multiple times will not return an error.

DtlsConnections will be automatically closed when the last reference is dropped, but you might want to call this function to make sure resources are released as early as possible.

If cancellable is cancelled, the DtlsConnection may be left partially-closed and any pending untransmitted data may be lost. Call close again to complete closing the DtlsConnection.

Parameters:

this

a DtlsConnection

cancellable

a Cancellable, or null

Returns:

true on success, false otherwise