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:
default0 2016-01-20 19:45:29 +01:00
parent 35e24667f0
commit 249341bc58
2 changed files with 13 additions and 2 deletions

View File

@ -312,8 +312,15 @@ Socket createSocket(string socketFile, ushort port)
}
else
{
socket = new Socket(AddressFamily.UNIX, SocketType.STREAM);
socket.connect(new UnixAddress(socketFile));
version(Windows)
{
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.blocking = true;

View File

@ -42,4 +42,8 @@ string generateSocketName()
"dcd.socket");
}
}
else
{
assert(0);
}
}