bind static method
Future<DtlsServer>
bind(
- dynamic host,
- int port,
- DtlsServerContext context, {
- int ttl = 1,
- DynamicLibrary? libCrypto,
- DynamicLibrary? libSsl,
- String? cryptoPath,
- String? sslPath,
Binds a DtlsServer to the given host and port, using the security
parameters defined in the context.
Uses a RawDatagramSocket internally and passes the host, port,
and ttl arguments to it.
Implementation
static Future<DtlsServer> bind(
dynamic host,
int port,
DtlsServerContext context, {
int ttl = 1,
DynamicLibrary? libCrypto,
DynamicLibrary? libSsl,
String? cryptoPath,
String? sslPath,
}) async {
final socket = await RawDatagramSocket.bind(host, port, ttl: ttl);
return DtlsServer(
socket,
context,
libCrypto: libCrypto,
libSsl: libSsl,
cryptoPath: cryptoPath,
sslPath: sslPath,
).._externalSocket = false;
}