Closed NOBLES5E closed 3 years ago
Hi @NOBLES5E,
"that are not in mio" can be ambiguous because mio
has an interface that allows you to use "whatever" you want. It's true that mio
comes with few protocols already prepared to use, but if you implement from Source
trait you can make your own protocol works with mio
. To make a message-io
adapter the only required from mio
is that you return this Source
. An example of that is the Websocket adapter, which uses a library that has nothing to do with mio
(tungstenite-rs
).
Having said that, I do not know about RDMA (Only the fast search I made 😄), and I can not see clearly the implications to use it with message-io
. Do you know about some rust library that implements RDMA?
Thanks for your reply! Recently I am thinking about writing software in Rust supporting RDMA (which could improve network performance a lot in many scenarios), and I am still in my first step to collect related information. There are libraries like https://github.com/jonhoo/rust-ibverbs. I also created an issue for tokio here: https://github.com/tokio-rs/tokio/issues/3637.
That sounds amazing! 😃
I was investigating a little bit about implementing your own protocol based on mio
and I retract to myself: you can implement the Source
trait only if you are using underlying something already Sourceable, this "recursion" ends when you are able to register the file descriptor in the poll (and so the poll can wake up based on the OS event over this file descriptor). Maybe only if you can access this file descriptor, then you could create a non-blocking resource for your protocol based on mio that others can use in their projects (as in tokio or message-io! 😋).
So, to summarize: If your protocol is based on TCP, UDP, UDS or uses a file descriptor, you should be able to implement it to works in a non-blocking mode with mio (and therefore you could make also an adapter for message-io*).
For example RDMA. Thanks!