22 releases

Uses new Rust 2024

new 0.5.0 May 4, 2025
0.4.1 Aug 15, 2023
0.3.1 Jan 22, 2023
0.2.4 Jan 17, 2023
0.1.14 Jun 21, 2021

#286 in Asynchronous

Download history 3/week @ 2025-02-18 2/week @ 2025-02-25 4/week @ 2025-03-11 5/week @ 2025-04-15 98/week @ 2025-04-22 110/week @ 2025-04-29

213 downloads per month

MIT/Apache

43KB
1K SLoC

tokio-smoltcp

A async wrapper for smoltcp.

Note

v0.1.x does not follow semver, the API may change at any time.

Example

See examples/pcap.rs.

cargo build --example pcap && sudo ./target/debug/examples/pcap -h

This example uses pcap as backend and do the following things:

  1. Bind a UDP port and send a DNS request to 114.114.114.114:53 and get the www.baidu.com's IP.
  2. Create a TcpStream and send a simple HTTP/1.0 request, then print the HTTP response.
  3. Create a echo server listening to 0.0.0.0:12345, accept incoming connections and send the data back.

Dependencies

~6–15MB
~196K SLoC