Skip to content

Commit 9a4f04e

Browse files
committed
Make EADDRINUSE non-fatal for IPv6 socket
1 parent 9c2f850 commit 9a4f04e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/server/ocsigen_socket.ml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ let make_sockets addr port =
4242
let ipv6_socket =
4343
try [make_ipv6_socket Unix.inet6_addr_any port]
4444
with Unix.Unix_error
45-
((Unix.EAFNOSUPPORT | Unix.EPROTONOSUPPORT),
46-
_, _) -> []
45+
((Unix.EAFNOSUPPORT
46+
| Unix.EPROTONOSUPPORT
47+
| Unix.EADDRINUSE (* GH issue #104 *)
48+
), _, _) -> []
4749
in
4850
(make_ipv4_socket Unix.inet_addr_any port)::ipv6_socket
4951
| IPv4 addr ->

0 commit comments

Comments
 (0)