RouterL0 class
Basic router implementation for relaying and forwarding datagrams.
This class provides a lightweight and efficient implementation of a network router, focusing on fast datagram relay and forwarding. It serves as a foundation for more advanced router implementations with additional features.
- Inheritance
-
- Object
- RouterBase
- RouterL0
- Implementers
Constructors
Properties
- crypto → Crypto
-
The cryptography instance used for encryption and signing.
finalinherited
- deltaT ↔ int
-
Defines the required clock synchronization accuracy between nodes, in
milliseconds.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- isNotRunning → bool
-
no setterinherited
- isRunning → bool
-
no setterinherited
- keepalivePeriod → Duration
-
The keepalive period, specifying the interval for sending keepalive
messages to peers.
finalinherited
- logger ↔ void Function(String)?
-
The logger used for logging events.
getter/setter pairinherited
- maxForwardsLimit ↔ int
-
Defines the maximum number of times a message can be forwarded.
getter/setter pair
- maxStoredHeaders ↔ int
-
The maximum number of stored headers for routes.
getter/setter pairinherited
- messageTTL ↔ Duration
-
The message time-to-live, specifying how long messages are considered
valid.
getter/setter pairinherited
- peerAddressTTL ↔ Duration
-
The peer address time-to-live, specifying how long peer addresses are
considered valid. Defaults to twice the keepalive period.
getter/setter pairinherited
-
routes
→ Map<
PeerId, Route> -
The routes maintained by the router, stored as a map of PeerId to
Route.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selfId → PeerId
-
no setterinherited
-
transports
→ List<
TransportBase> -
The transports used for network communication.
finalinherited
- useForwardersLimit ↔ int
-
Defines the maximum number of forwarders to use for message delivery.
getter/setter pairinherited
Methods
-
init(
[Uint8List? seed]) → Future< Uint8List> -
Initializes the router.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onMessage(
Packet packet) → Future< Packet> -
Handles incoming messages.
override
-
resolvePeerId(
PeerId peerId) → Iterable< FullAddress> -
Resolves a Peer ID to a set of network addresses.
inherited
-
sendDatagram(
{required Iterable< FullAddress> addresses, required Uint8List datagram}) → void -
Sends a datagram to the specified addresses.
inherited
-
start(
) → Future< void> -
Starts the router.
inherited
-
stop(
) → void -
Stops the router.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited