quinn-rs / quinn

Async-friendly QUIC implementation in Rust
Apache License 2.0
3.57k stars 363 forks source link

Create my own AsyncUdpSocket #1847

Closed szguoxz closed 1 month ago

szguoxz commented 1 month ago

I want to do something funny before the data hit quinn, so I am looking into AsyncUdpSocket. for linux, I found send and recv is not symmetrical. For Send, we send out a transmit, but for Recv, we received a slice of IoSliceMut and RecvMeta. Here is the structure of RecvMeta: pub struct RecvMeta { pub addr: SocketAddr, pub len: usize, pub stride: usize, pub ecn: Option, pub dst_ip: Option, } Just want to confirm that: info in every RecvMeta would be the same except: len and stride, right, after all, they are from the same transmit? Is it possible a recv will combine two transmit together? That's what I am trying to be sure.

For windows, it seems much simpler, you always only recv one recvmeta.

Thanks.

Ralith commented 1 month ago

AsyncUdpSocket presents a high-level interface around recvmmsg; refer to its documentation for specifics. There is no particular relationship to any specific group of transmit operations.