Skip to content

example: netlink crate#158

Open
polachok wants to merge 1 commit into
smol-rs:masterfrom
polachok:netlink-example
Open

example: netlink crate#158
polachok wants to merge 1 commit into
smol-rs:masterfrom
polachok:netlink-example

Conversation

@polachok

@polachok polachok commented Jun 3, 2020

Copy link
Copy Markdown
Contributor

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

little-dude commented Jun 7, 2020

Copy link
Copy Markdown

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

polachok commented Jun 7, 2020

Copy link
Copy Markdown
Contributor Author

@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
Copy Markdown

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.

2 participants