LanTransport constructor
LanTransport({})
Creates a transport.
discoveryInterval controls how often the network is re-browsed for new
peers. reconnectBaseDelay and reconnectMaxDelay bound the exponential
backoff used when re-dialing a dropped peer.
maxInboundConnections, helloTimeout and maxFrameBytes bound what an
inbound connection from the network may cost: a connection beyond the
cap is closed, one that has not named itself within helloTimeout is
evicted, and one that sends a message larger than maxFrameBytes is
closed. Hygiene against floods, not authentication: a node id is only a
claim, and peers are authenticated by Passnote's signed session
handshake.
Implementation
LanTransport({
Duration discoveryInterval = const Duration(seconds: 5),
Duration reconnectBaseDelay = const Duration(seconds: 2),
Duration reconnectMaxDelay = const Duration(seconds: 60),
this.maxInboundConnections = 64,
this.helloTimeout = const Duration(seconds: 10),
this.maxFrameBytes = 4 << 20,
}) : _discoveryInterval = discoveryInterval,
_reconnectBaseDelay = reconnectBaseDelay,
_reconnectMaxDelay = reconnectMaxDelay;