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

Socket2 use for Mio #56

Closed
Thomasdezeeuw opened this issue Mar 29, 2020 · 6 comments
Closed

Socket2 use for Mio #56

Thomasdezeeuw opened this issue Mar 29, 2020 · 6 comments

Comments

@Thomasdezeeuw
Copy link
Collaborator

Hello I'm the maintainer of Mio and I want to support some additional API around sockets. To not duplicate the effort around raw socket handling I think socket2 would be a good fit.

However I do have some questions. What is the status of maintenance of this crate? I've read @alexcrichton message some time ago that he'll be taking a step back from Rust (sorry to see you go and thanks for all you've done!). I'm willing to help maintain this crate if its a good fit for Mio.

I'm also looking to change the API a bit. I've being doing some experiments here: https://github.com/Thomasdezeeuw/socket2, diff: master...Thomasdezeeuw:master. The basic idea follows the same philosophy as Mio with OS specific API: make setters only available on OSes that support it and getters on all platforms (returning a negative/false value if not supported). For example mio::Interest::LIO is only available on FreeBSD, but its getter is available on all platforms.

Furthermore I would like to structure the code a bit differently. Moving the struct definitions to the same file as the commonly supported API, but move OS specific additional API to the sys/ dir. For example the common API for Domain: https://github.com/Thomasdezeeuw/socket2/blob/279c289e0af232167c7b67560b6c64e60ef0069c/src/lib.rs#L63-L112. And the Unix specific API is located in sys/unix.rs: https://github.com/Thomasdezeeuw/socket2/blob/279c289e0af232167c7b67560b6c64e60ef0069c/src/sys/unix.rs#L32-L44.

Let me know what you guys think.

@Thomasdezeeuw
Copy link
Collaborator Author

Thomasdezeeuw commented Mar 29, 2020

An example of restructuring the API: #57.

@ghost
Copy link

ghost commented Mar 29, 2020

Hey everyone, another user relying on this crate chiming in - currently developing and wrapping up an alternative to mio (similar capabilities, but much simpler and 100% safe), which would not be possible without socket2, so here's another thank you!

I would also be interested in helping maintain this crate :)

@alexcrichton
Copy link
Member

Hello and thanks for reaching out! I do indeed not necessarily have a ton of time (or interest at this point) to maintain this crate. I'm happy to help keep it alive though, and would love to have help if others are interested!

@sfackler has also helped out with this crate historically (I think? If not feel free to unsubscribe). I don't mind modernizing this and/or reorganizing it. I would like to keep the spirit of the crate though where it's an extremely thin wrapper around the OS without extra abstraction and such. Given what I've seen so far though it looks like that won't be an issue :)

Perhaps @Thomasdezeeuw and @stjepang y'all could help out with some PRs/reviews of those PRs and if everything looks good I can add y'all as maintainers?

@Thomasdezeeuw
Copy link
Collaborator Author

@alexcrichton sound good, I'll start sending prs and ping @stjepang for reviews (if you're OK with that @stjepang).

@ghost
Copy link

ghost commented Mar 30, 2020

Sounds great to me, let's do that!

@Thomasdezeeuw Thomasdezeeuw added this to the V0.4 milestone Dec 28, 2020
@Thomasdezeeuw Thomasdezeeuw removed this from the V0.4 milestone Mar 13, 2021
@Thomasdezeeuw
Copy link
Collaborator Author

Continuing in #212.

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

No branches or pull requests

2 participants