tryCloseClient method

Future<void> tryCloseClient()

If the dtlsClient is not null, this method will close it.

If the dtlsClient is null, there is nothing that can be done anyway; so, do nothing here.

Implementation

Future<void> tryCloseClient() async {
  if (dtlsClient == null) return;

  await dtlsClient!.close();

  dtlsClient = null;
}