mirror of https://github.com/nodejs/node.git
Set SO_REUSEADDR on all sockets
parent
11a784d6da
commit
341e41726f
|
@ -74,6 +74,8 @@ static inline bool SetNonBlock(int fd) {
|
||||||
|
|
||||||
|
|
||||||
static inline bool SetSockFlags(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);
|
return SetNonBlock(fd) && SetCloseOnExec(fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue