Expand description
Network communication and peer management
This module handles all network-related functionality, including peer discovery, message sending/receiving, and connection management in the distributed system.
Structs§
- NETWORK_
MANAGER - Network
Manager - Manages network connections and peer communication
- Peer
Connection - Represents a connection to a peer node
Functions§
- announce
- Announces this node’s presence to potential peers in the network. If the user gave peers in args, we will only connect to those peers. If not, we will scan the port range and try connecting to all sockets.
- diffuse_
message - Implement our wave diffusion protocol
- diffuse_
message_ without_ lock - Implement our wave diffusion protocol
- handle_
network_ message - Handles incoming messages from a peer Implement our wave diffusion protocol
- send_
message - Send a message to a specific peer
- spawn_
writer_ task - Spawns a task to handle writing messages to a peer connection
- start_
listening - Starts listening for messages from a new peer