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

Socket API #241

Open
FrankReh opened this issue Feb 18, 2023 · 3 comments
Open

Socket API #241

FrankReh opened this issue Feb 18, 2023 · 3 comments

Comments

@FrankReh
Copy link
Collaborator

I noticed a TODO in the Socket's bind_internal method about possibly using or exposing the socket2::Socket's set_send_buffer_size and set_recv_buffer_size methods.

Should we have a builder api or should we expose the fd as a socket2::Socket or is it enough that as_raw_fd can be called on it?

I notice that the TcpListener and UnixListener do not provide an as_raw_fd.

If we know what we're doing now, I'd like to replace that TODO with a comment or documentation about how the user can set additional socket kernel parameters.

@Noah-Kennedy
Copy link
Contributor

We should definitely provide AsRawFd, and also try and match the APIs from tokio (except for maybe TcpSocket)

@Icelk
Copy link
Contributor

Icelk commented Mar 19, 2023

I definitely think the socket2 interface should be exported.

I'm thinking of using this for my multi-threaded web server. This being a single-threaded runtime only, I would set up multiple listeners with reuse_port enabled. That's however currently not possible (without transmuting, of course :)).

@Icelk
Copy link
Contributor

Icelk commented Mar 27, 2023

This is fixed in master. Should we close?

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

3 participants