don't try to set the SO_REUSEPORT flag
On Linux this option was always set, regardless if the `StreamListenOptions` specifies it. On some systems setting that option will result in a failure.
This commit is contained in:
parent
36f43690c6
commit
cb06ecfbcf
|
@ -220,7 +220,7 @@ final class PosixEventDriverSockets(Loop : PosixEventLoop) : EventDriverSockets
|
||||||
() @trusted {
|
() @trusted {
|
||||||
int tmp_reuse = 1;
|
int tmp_reuse = 1;
|
||||||
// FIXME: error handling!
|
// FIXME: error handling!
|
||||||
if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &tmp_reuse, tmp_reuse.sizeof) != 0) {
|
if ((options & StreamListenOptions.reusePort) && setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &tmp_reuse, tmp_reuse.sizeof) != 0) {
|
||||||
invalidateSocket();
|
invalidateSocket();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue