internet_simulator

Crates.iointernet_simulator
lib.rsinternet_simulator
version0.1.1
created_at2025-12-09 10:09:14.347381+00
updated_at2025-12-09 10:20:35.198769+00
descriptionA virtual network simulator with message routing for experimenting with Kademlia-like distributed systems.
homepage
repositoryhttps://github.com/098orin/internet_simulator
max_upload_size
id1975203
size26,996
(098orin)

documentation

README

Internet Simulator for rust

A simple network simulator written in Rust.

Example

use internet_simulator::{Net, Address};
use tokio::time::{sleep, Duration};

#[tokio::main]
async fn main() {
    let net = Net::new();

    let a = net.register_node(Address(1), Some("A".into())).await;
    let b = net.register_node(Address(2), Some("B".into())).await;

    // A → B 
    a.send(Address(2), "hello!").await;

    // B receives
    if let Some(msg) = b.recv().await {
        println!("B received: {:?}", msg);
    }
}
Commit count: 0

cargo fmt