Gives an abstraction to allow for different network router algorithms, e.g., random_connections, dht_network, loopix, and others. It defines a basic set of messages and a broker, which can then be extended to work with the different network connection modules.
Two examples are implemented:
RouterRandom
uses theRandomConnection
broker to handle the network and forwards messages as appropriateRouterDirect
uses theNetwork
broker to handle the network. One problem with this is that theConnected
andDisconnected
messages from theNetwork
broker need to be handled here.
To implement a new example who has the Available
, Connected
, Disconnected
messages, the simplest way is to
copy RouterRandom
into a new broker.
The network
-module will sooner or later be replaced with another WebRTC implementation, perhaps
with https://crates.io/crates/matchbox_socket, https://crates.io/crates/litep2p, or
https://crates.io/crates/just-webrtc.