Open johanmickos opened 6 years ago
There still does not appear to be any change to the state of this in the Rust ecosystem. The only native rewrite attempt appears to be abandoned.
What about QUIC ? It is loosely inherited from UDT. 2 rust implementations of it Quiche and Quinn both interoperable with tokio/mio.
What about QUIC ? It is loosely inherited from UDT. 2 rust implementations of it Quiche and Quinn both interoperable with tokio/mio.
Just taking a quick look at the two mentioned libraries, I'm thinking this may be a pretty good option, actually. I particularly like the support unordered streams as a feature, which UDT didn't have iirc.
We'll have some internal discussions and try to get it on the roadmap. It's certainly more alive than UDT.
We want to enable UDT in the transport layer. UDT comes as a C++ library with a small API surface, and gluing it to be supported in Rust is surprisingly simple (see this repo, for example).
Theoretical Approach
Evented
interfaceProblems
Mio allows two ways to register a pollable resource through its
Evented
interface: (1) user handles, driven in user-space by hand-written "readiness" updates; and (2) system file handles such as sockets that can be monitored by the system selector, thus delegating readiness updates to the operating system.The epoll-like API exposed by UDT operates on logical UDT sockets rather than system-specific file descriptors. This means that there's no system file handle providing epoll-like capabilities that Mio's
Evented
can use. For Mio integration, we're left with option #2: writing a dedicated user-space poller which drives the readiness state of UDT sockets (presumably from a separate thread). In other words, re-writing thePoll
functionality found in Mio to work on "something that looks like epoll but isn't necessarily the system selector."There is a problem with the user-space
Evented
types, though: they come with very few guarantees. See the Mio quote below:What about Netty?
Netty uses a very complex tree of interfaces and abstract classes. Netty also supports Java's NIO tree of interfaces and abstract classes. Within NIO, we find selectors which multiplex channels. The API exposed by the UDT library fits quite nicely into NIO's selectors, and thus Netty's single-threaded NioEventLoop can drive the polling on the UDT resources and pipeline them through the rest of Netty's features.
Potential Workarounds