Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to support transport protocols that are not in mio? #64

Closed
NOBLES5E opened this issue Mar 23, 2021 · 3 comments
Closed

How to support transport protocols that are not in mio? #64

NOBLES5E opened this issue Mar 23, 2021 · 3 comments
Labels
question Further information is requested

Comments

@NOBLES5E
Copy link

For example RDMA. Thanks!

@lemunozm
Copy link
Owner

lemunozm commented Mar 23, 2021

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?

@lemunozm lemunozm added the question Further information is requested label Mar 23, 2021
@NOBLES5E
Copy link
Author

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: tokio-rs/tokio#3637.

@lemunozm
Copy link
Owner

lemunozm commented Mar 24, 2021

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants