mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
Set SO_REUSEADDR on all sockets
This commit is contained in:
1 parent
11a784d6da
commit
341e41726f
1 file changed
+2
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user