diff --git a/src/node_net.cc b/src/node_net.cc index 622f41dd948..f5a15ccb7f7 100644 --- a/src/node_net.cc +++ b/src/node_net.cc @@ -74,6 +74,8 @@ static inline bool SetNonBlock(int fd) { static inline bool SetSockFlags(int fd) { + int flags = 1; + setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (void *)&flags, sizeof(flags)); return SetNonBlock(fd) && SetCloseOnExec(fd); }