tokio-rs / io-uring

The `io_uring` library for Rust
Apache License 2.0
1.16k stars 129 forks source link

Added option to use SendZc for connectionless streams. #228

Closed serzhiio closed 1 year ago

serzhiio commented 1 year ago

With this changes we can set destination address. It is usefull when working with connectionless UDP, like .send_to().

let std = SocketAddrV6::new(Ipv6Addr::new(1, 2, 3, 4, 5, 6, 7, 8), 9876, 11, 12);
let dest_addr = SockAddr::from(std);
let sendzc = opcode::SendZc::new(Fd(self.as_raw_fd()), buf.as_ptr(), buf.len() as _)
    .dest_addr(dest_addr.as_ptr())
    .dest_addr_len(dest_addr.len())
    .build()
    .user_data(1);
serzhiio commented 1 year ago

test added

serzhiio commented 1 year ago

With IO_LINK flag i hope we can rely on consistency UPD: No, order is different from time to time, thinking...

quininer commented 1 year ago

Thank you!