Merge pull request #103 from rracariu/master

Don't try to set the SO_REUSEPORT flag on Linux
This commit is contained in:
Sönke Ludwig 2019-02-23 14:03:17 +01:00 committed by GitHub
commit b08bd6a9db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -220,7 +220,7 @@ final class PosixEventDriverSockets(Loop : PosixEventLoop) : EventDriverSockets
() @trusted {
int tmp_reuse = 1;
// 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();
return;
}