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

example: netlink crate #158

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

polachok
Copy link
Contributor

@polachok polachok commented Jun 3, 2020

Not sure if it's appropriate, but I think it's kinda cool to show that smol works with netlink sockets out of the box too.

Feel free to close.

@little-dude
Copy link

little-dude commented Jun 7, 2020

I don't know smol, so I have to ask: how/why does that work? netlink-sys is currently only compatible with tokio. I actually have an issue open for making the crate compatible with other runtimes: little-dude/netlink#77

I mean, is let mut socket = Async::new(socket)?; really the only thing to do that have it working? 🤯

@polachok
Copy link
Contributor Author

polachok commented Jun 7, 2020

@little-dude yes! smol only requires AsRawFd to insert socket into reactor and then you register interest in events by using read_with_*/write_with_* methods. You can think of Async as PollEvented in tokio land, but nicer, no need for wrappers any more.

@little-dude
Copy link

Very cool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants