DtlsClient constructor

DtlsClient(
  1. RawDatagramSocket _socket, {
  2. DynamicLibrary? libSsl,
  3. DynamicLibrary? libCrypto,
  4. String? cryptoPath,
  5. String? sslPath,
})

Creates a new DtlsClient that uses a pre-existing RawDatagramSocket.

If you want to load libSsl or libCrypto yourself (e.g., from a custom path), you can pass custom OpenSslFfi objects to this constructor.

Implementation

DtlsClient(
  this._socket, {
  DynamicLibrary? libSsl,
  DynamicLibrary? libCrypto,
  String? cryptoPath,
  String? sslPath,
})  : _libCrypto = loadLibCrypto(libCrypto, path: cryptoPath),
      _libSsl = loadLibSsl(libSsl, path: sslPath) {
  _startListening();
}