How does tokio-rs/tokio-uring detect the failure by tokio-rs/io-uring, in the following example:
let (result, nbuf) = stream.read(buf).await;
buf = nbuf;
let read = result.unwrap();
if read == 0 {
println!("{} closed, {} total ping-ponged", socket_addr, n);
break;
}
What does it do to avoid waiting infinitely, or even notifying that the operation failed, shouldn't it return an enum Result ?
In io_uring, every submitted operation – such as prep_recv – is completed with a CQE (Completion Queue Event) that carries a result code. This code may indicate that the operation was successful (non-negative value).
That said, shouldn't the library at least return success or failure information to the user?