Fix compiler errors on windows
Checking the repo out and running dub to build on windows would give two compiler errors, one because UnixAddress is not defined another because a function misses a return statement if Unix sockets are not possible.
This commit is contained in:
parent
35e24667f0
commit
249341bc58
|
@ -312,8 +312,15 @@ Socket createSocket(string socketFile, ushort port)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
socket = new Socket(AddressFamily.UNIX, SocketType.STREAM);
|
version(Windows)
|
||||||
socket.connect(new UnixAddress(socketFile));
|
{
|
||||||
|
throw new Exception("Cannot use UNIX domain sockets on Windows.");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
socket = new Socket(AddressFamily.UNIX, SocketType.STREAM);
|
||||||
|
socket.connect(new UnixAddress(socketFile));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
socket.setOption(SocketOptionLevel.SOCKET, SocketOption.RCVTIMEO, dur!"seconds"(5));
|
socket.setOption(SocketOptionLevel.SOCKET, SocketOption.RCVTIMEO, dur!"seconds"(5));
|
||||||
socket.blocking = true;
|
socket.blocking = true;
|
||||||
|
|
|
@ -42,4 +42,8 @@ string generateSocketName()
|
||||||
"dcd.socket");
|
"dcd.socket");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
assert(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue