Skip to content

reuse_addr and reuse_port parameters are ignored in luv #366

Closed
@bikallem

Description

@bikallem

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)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions