MIO
libpnet
MIO | libpnet | |
---|---|---|
21 | 4 | |
6,403 | 2,313 | |
1.1% | 1.0% | |
8.5 | 7.3 | |
4 days ago | 4 months ago | |
Rust | Rust | |
MIT License | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
MIO
-
What's the canonical way of doing it in rust?
Was playing around with mio (https://github.com/tokio-rs/mio) (not that mio itself is very important here!) and was trying to implement a simple something that I've done in java before: a Reactor that you can register ReactorClients with that will get callback whenever there are events on the corresponding socket etc.
-
RFC: A non-blocking networking library for Rust
How does it compare to mio?
-
How does the Rust mio crate implement deregistering connections?
TcpStream gets its wake behavior by delegating to the fd wakers. The Unix wakers have a few implementations, for different platforms. On Linux and Android, epoll is used.
-
Looking for Tokio's event loop source code
The real implementation details of the I/O event queue is done in mio as u/hniksic pointed out, but that's more comparable with libuv which is certainly a huge part of the Node runtime. mio and libuv have a lot of similarities (at least they used to).
-
Python multi-level break and continue
My example was "twice by one developer", not "twice across all indexed repos."
A spot check shows that quite a few in your link are used specifically to ensure correct handling of Rust multi-level breaks work syntax, like https://github.com/rust-lang/rust-analyzer/blob/master/crate... , https://github.com/rust-lang/rustfmt/blob/master/tests/sourc... , https://github.com/rust-lang/rust/blob/master/src/tools/rust... , https://github.com/rust-lang/rust/blob/master/src/tools/rust... and likely more.
Another is a translation of BASIC code to Rust, using break as a form of goto. https://github.com/coding-horror/basic-computer-games/blob/e...
The example at https://github.com/tokio-rs/mio/blob/master/tests/tcp.rs is a nice one
// Wait for our TCP stream to connect
-
Crates to help with event-loop type pattern?
In my program, I have about 6 different components that follow the pattern below. Basically, the components run a thread while polling on crossbeam channels, file descriptors or sockets. For polling, I am using Mio (https://github.com/tokio-rs/mio).
-
Ask HN: Has any Rust developer moved to embedded device programming?
On the code side it's pretty much the same as C++. You have a module that defines an interface and per-platform implementations that are included depending on a "configuration conditional checks" #[cfg(target_os = "linux")] macro.
https://github.com/tokio-rs/mio/blob/c6b5f13adf67483d927b176...
- Mio - Metal io library for rust
-
`wasm32-wasi` support added to Tokio
Made possible by Wasi support for Mio https://github.com/tokio-rs/mio/pull/1576
-
What is the point of async and await?
Indeed! In practice it's done through the polling operation: instead of a separate poll for op1 and op2, the program essentially tells the OS "wake me when either op1 or op2 is ready" (through the epoll syscall on Linux). The mio crate implements this, and the example on the readme is basically the same loop, but written with this polling strategy in mind.
libpnet
-
Packet capture (use PcapPlusPlus in Rust?)
Hey, I'm looking for the best way to do packet capture in Rust. I've looked at both libpnet and pcap crates, and they both seem way less mature and with less functionality than the PcapPlusPlus library, which seems to be the golden suite of packet capture and manipulation.
-
tcpdump is amazing (2016)
> I mentioned really briefly that tcpdump lets you save pcap files. This is awesome because literally every network analysis tool in the universe understands pcap files. pcap files are like freshly baked chocolate chip cookies. Everybody loves them.
OMG, yes, very well put. When I get a bug report with a pcap file I know I'll be able to know exactly what happened.
Speaking of which: for one of my libraries, I want to make a diagnostic tool that replays an interaction. My library mostly operates at the TCP level (also some UDP), so I need to reconstruct the TCP flows in my tool to feed to my library. Either I need an easy-to-use Rust library to do that directly from pcap files [1] or some format that represents bytes moving over the flow (like sets of lines with a timestamp, flow id, and pretty hexdump of the bytes) with a tool that produces it from pcap. This seems like something that should exist? Wireshark's “Analyze > Follow > TCP Stream”’s “Save As…” with "hex dump" is kind of what I want, but it doesn't have timestamps, and it doesn't have a way to put everything (multiple flows, UDP packets also) in one file.
[1] https://crates.io/crates/pnet looks promising but it wasn't as obvious as I hoped how to plug it in for what I want.
-
Low Level Networking/Packet Manipulation
libpnet provides a cross-platform API for low level networking using Rust.
- TCP Assembly library?
What are some alternatives?
tokio
rust-zmq - Rust zeromq bindings.
protocol - Easy protocol definitions in Rust
tokio - A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...
actix - Actor framework for Rust.
glommio - Glommio is a thread-per-core crate that makes writing highly parallel asynchronous applications in a thread-per-core architecture easier for rustaceans.
hydrogen - Multithreaded, non-blocking Linux server framework in Rust
sniffnet - Comfortably monitor your Internet traffic 🕵️♂️
message-io - Fast and easy-to-use event-driven network library.
zenoh - zenoh unifies data in motion, data in-use, data at rest and computations. It carefully blends traditional pub/sub with geo-distributed storages, queries and computations, while retaining a level of time and space efficiency that is well beyond any of the mainstream stacks.