diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2010-07-17 23:10:38 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-07-17 23:10:38 -0700 |
commit | 341e41726febd84565cf7a4fbf2b13143faf7e0d (patch) | |
tree | 6fe94a711ae41cd891fc548c7444d4a120b4c81a /src/node_net.cc | |
parent | 11a784d6da1bbd3aea74fddc52c1e4dca7934ec9 (diff) | |
download | node-new-341e41726febd84565cf7a4fbf2b13143faf7e0d.tar.gz |
Set SO_REUSEADDR on all sockets
Diffstat (limited to 'src/node_net.cc')
-rw-r--r-- | src/node_net.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/node_net.cc b/src/node_net.cc index 622f41dd94..f5a15ccb7f 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); } |