Open jyn514 opened 2 years ago
Is your feature request related to a problem? Please describe.
I have a Unix socket where I want to call libc::sendmsg on the file descriptor directly. Right now, I have to use
libc::sendmsg
let guard = async_fd.writable().await; sendmsg(...); guard.clear_ready();
which is error prone.
Describe the solution you'd like
It would be convenient to allow using try_io instead, like for UdpSocket:
async_fd.try_io(Interest::WRITABLE, || sendmsg(...));
Describe alternatives you've considered Keep using writable() guard. Implement sendmsg APIs in tokio directly (https://github.com/tokio-rs/tokio/issues/2975).
writable()
Additional context https://discord.com/channels/500028886025895936/500336333500448798/979801318375964733
This seems like a good idea.
I'd like to give this a try
@jyn514 we have unix socket types, why not use those for your use case?
@Noah-Kennedy I have a trait that abstracts over different socket types.
Ah ok
Is your feature request related to a problem? Please describe.
I have a Unix socket where I want to call
libc::sendmsg
on the file descriptor directly. Right now, I have to usewhich is error prone.
Describe the solution you'd like
It would be convenient to allow using try_io instead, like for UdpSocket:
Describe alternatives you've considered Keep using
writable()
guard. Implement sendmsg APIs in tokio directly (https://github.com/tokio-rs/tokio/issues/2975).Additional context https://discord.com/channels/500028886025895936/500336333500448798/979801318375964733