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

reuse_addr and reuse_port parameters are ignored in luv #366

Closed
bikallem opened this issue Nov 9, 2022 · 0 comments
Closed

reuse_addr and reuse_port parameters are ignored in luv #366

bikallem opened this issue Nov 9, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@bikallem
Copy link
Contributor

bikallem commented Nov 9, 2022

Eio.Net.listen and datagram_socket functions ignore reuse_addr and reuse_port parameter in luv backend (https://github.com/ocaml-multicore/eio/blob/main/lib_eio_luv/eio_luv.ml#L753-L754).

Some observations on luv backend:
it seems libuv creates tcp sockets with reuse_addr = true by default (https://github.com/libuv/libuv/blob/7bccb562e415030050cfbd1e69eeefd69ce57aca/src/unix/tcp.c#L164). Therefore if reuse_addr = false we need to set the socket option explicitly.

For udp sockets, it seems to be reuse_addr=false by default. (https://github.com/libuv/libuv/blob/dff3f8ccabee15b1545523329e39e7acd2e77563/src/win/udp.c#L221)

@bikallem bikallem self-assigned this Nov 9, 2022
@bikallem bikallem added the bug Something isn't working label Nov 9, 2022
@bikallem bikallem linked a pull request Nov 9, 2022 that will close this issue
@bikallem bikallem changed the title luv: Eio.Net.listen and datagram_socket ignores reuse_addr and reuse_port parameter reuse_addr and reuse_port parameters are ignored in luv Nov 9, 2022
@talex5 talex5 mentioned this issue Feb 2, 2023
@talex5 talex5 closed this as completed Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants