[domistream] ENet host: tests first (client against host over an in-memory lossy wire), API stubs

EnetHostPeer is the accepting side, one peer per client address. The tests drive our EnetClient against it with simulated time, loss, duplication and reordering, plus a scripted client for the stock ENet 1.3 facts (verify connect fields, session ids, what is acknowledged when). They fail against the stubs.
This commit is contained in:
2026-12-04 12:24:14 +01:00
parent eae3b9e754
commit e77c5fcd83
5 changed files with 1352 additions and 0 deletions
+3
View File
@@ -24,8 +24,11 @@ use protocol::{Command, CommandBody, ConnectParams, Datagram, Fragment, MAX_DATA
use crate::util::malformed;
use crate::{Error, Instant, RandomSource, Result};
pub mod host;
pub mod protocol;
pub use host::{ConnectRequest, EnetHostConfig, EnetHostEvent, EnetHostPeer, EnetHostState, parse_connect_request};
/// Maximum size of one reassembled packet, in bytes (control messages are small; this caps fragment memory).
pub const MAX_PACKET_BYTES: usize = 64 * 1024;
/// Maximum number of packets queued for sending before [`EnetClient::send`] refuses more.