caio.co/de/foca

agent example: assume a small LAN cluster

Id
1b29999bee3d64d65678f9d0483f39427344f360
Author
Caio
Commit time
2024-03-19T11:37:16+01:00

Modified examples/foca_insecure_udp_agent.rs

@@ -213,14 +213,7
} = params;

let rng = StdRng::from_entropy();
- let config = {
- let mut c = Config::simple();
- // With this setting you can suspend (^Z) one process,
- // wait for it the member to be declared down then resume
- // it (fg) and foca should recover by itself
- c.notify_down_members = true;
- c
- };
+ let config = Config::new_lan(std::num::NonZeroU32::new(10).unwrap());

let buf_len = config.max_packet_size.get();
let mut recv_buf = vec![0u8; buf_len];