DtlsClient class
Client for connecting to DTLS Servers and sending UDP packets with encrpyted payloads afterwards.
Uses a RawDatagramSocket for connection establishment and sending. This socket can either be created by the DtlsClient itself, using the bind method, or provided by the user with the regular constructor.
Connections to a peer are established using the connect method. If the connection is successful, a DtlsConnection is returned that can be used for sending the actual application data.
Closing the DtlsClient with the close method also closes all existing DtlsConnections.
Constructors
- DtlsClient(RawDatagramSocket _socket, {DynamicLibrary? libSsl, DynamicLibrary? libCrypto, String? cryptoPath, String? sslPath})
- Creates a new DtlsClient that uses a pre-existing RawDatagramSocket.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
close(
{bool closeExternalSocket = false}) → Future< void> - Closes this DtlsClient.
-
connect(
InternetAddress address, int port, DtlsClientContext context, {String? hostname, Duration? timeout}) → Future< DtlsConnection> -
Establishes a DtlsConnection with a peer using the given
addressandport. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
bind(
dynamic host, int port, {bool reuseAddress = true, bool reusePort = false, int ttl = 1, DynamicLibrary? libSsl, DynamicLibrary? libCrypto, String? cryptoPath, String? sslPath}) → Future< DtlsClient> -
Binds a DtlsClient to the given
hostandport.