tryDispose method

Future<void> tryDispose()

Closes the dtlsClient and disconnects the connection.

This is a convenience method that calls tryCloseClient and tryDisconnect in sequence.

If the dtlsClient is null or the connection is null, they will be ignored.

Implementation

Future<void> tryDispose() async {
  await tryDisconnect();
  await tryCloseClient();
}