Closed cathay4t closed 1 year ago
Introduced this async API via DhcpV4ClientAsync. Example usage:
let mut cli = DhcpV4ClientAsync::init(config, None).unwrap(); while let Some(l) = cli.next().await { match l { Ok(lease) => { println!("Got lease {lease:?}"); } Err(e) => { eprintln!("Got error {e:?}"); break; } } }
We use Stream instead Future because we need to renew the lease with DHCP server.
Stream
Future
Proxy mode is also works via initiating DhcpV4ClientAsync with DhcpV4Config::new_proxy();
DhcpV4ClientAsync
DhcpV4Config::new_proxy();
Example and integration test included.
Misc:
mzc
Introduced this async API via DhcpV4ClientAsync. Example usage:
We use
Stream
insteadFuture
because we need to renew the lease with DHCP server.Proxy mode is also works via initiating
DhcpV4ClientAsync
withDhcpV4Config::new_proxy();
Example and integration test included.
Misc:
mzc
CLI to minimize the dependency and speed up the compile time.