forked from quic-go/quic-go
add simnet package to simulate a net.PacketConn in memory (#5385)
* Implement simnet * simnet: remove separate license * simnet: remove go.mod, use standard require package * simnet: add README * simnet: use synctest wrapper in tests * simnet: minor code cleanup * simnet: expose Packet.Data * simnet: explose Simnet.Router * simnet: remove SimpleFirewallRouter * simnet: remove stray fmt.Println in tests * fix deadline check for write deadlines Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * simnet: fix SetReadDeadline logic --------- Co-authored-by: Marco Munizaga <git@marcopolo.io> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
16
testutils/simnet/README.md
Normal file
16
testutils/simnet/README.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# simnet
|
||||
|
||||
This package is based on @MarcoPolo's [simnet](https://github.com/marcopolo/simnet) package.
|
||||
|
||||
A small Go library for simulating packet networks in-process. It provides
|
||||
drop-in `net.PacketConn` endpoints connected through configurable virtual links
|
||||
with bandwidth, latency, and MTU constraints. Useful for testing networking code
|
||||
without sockets or root privileges.
|
||||
|
||||
- **Drop-in API**: implements `net.PacketConn`
|
||||
- **Realistic links**: per-direction bandwidth, latency, and MTU
|
||||
- **Backpressure/buffering**: bandwidth–delay product aware queues
|
||||
- **Routers**: perfect delivery, fixed-latency, simple firewall/NAT-like routing
|
||||
- **Deterministic testing**: opt-in `synctest`-based tests for time control
|
||||
|
||||
|
||||
Reference in New Issue
Block a user