Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

unix: set SO_REUSEADDR before binding

  • Loading branch information...
wankdanker authored and bnoordhuis committed Nov 23, 2011
1 parent 32b291d commit b674187c38c70772fd2de14de3d727438eb87c8a
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/unix/udp.c
@@ -334,6 +334,12 @@ static int uv__bind(uv_udp_t* handle,
goto out;
}

yes = 1;
if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof yes) == -1) {
uv__set_sys_error(handle->loop, errno);
goto out;
}

if (flags & UV_UDP_IPV6ONLY) {
#ifdef IPV6_V6ONLY
yes = 1;

0 comments on commit b674187

Please sign in to comment.
You can’t perform that action at this time.