Set SO_REUSEADDR on all sockets
This commit is contained in:
parent
11a784d6da
commit
341e41726f
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user