tokio-smoltcp

Crates.iotokio-smoltcp
lib.rstokio-smoltcp
version0.4.1
sourcesrc
created_at2021-06-07 12:18:23.691312
updated_at2023-08-15 13:23:02.033884
descriptionAn asynchronous wrapper for smoltcp.
homepagehttps://github.com/spacemeowx2/tokio-smoltcp
repositoryhttps://github.com/spacemeowx2/tokio-smoltcp.git
max_upload_size
id407283
size73,217
imspace (spacemeowx2)

documentation

https://docs.rs/tokio-smoltcp/

README

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.
Commit count: 71

cargo fmt