RouterBase constructor
RouterBase({})
Implementation
RouterBase({
Crypto? crypto,
List<TransportBase>? transports,
this.messageTTL = const Duration(seconds: 3),
this.keepalivePeriod = const Duration(seconds: 15),
this.logger,
}) : crypto = crypto ?? Crypto() {
// Initialize transports with provided or default UDP transports.
this.transports.addAll(
transports ??
[
TransportUdp(
bindAddress: FullAddress(
address: InternetAddress.anyIPv4,
port: TransportUdp.defaultPort,
),
ttl: messageTTL.inSeconds,
),
TransportUdp(
bindAddress: FullAddress(
address: InternetAddress.anyIPv6,
port: TransportUdp.defaultPort,
),
ttl: messageTTL.inSeconds,
),
],
);
}