Merge pull request #285 from default0/master
Fix compiler errors on windows
This commit is contained in:
commit
f226487b33
|
@ -311,10 +311,17 @@ Socket createSocket(string socketFile, ushort port)
|
||||||
socket.connect(new InternetAddress("localhost", port));
|
socket.connect(new InternetAddress("localhost", port));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
version(Windows)
|
||||||
|
{
|
||||||
|
throw new Exception("Cannot use UNIX domain sockets on Windows.");
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
socket = new Socket(AddressFamily.UNIX, SocketType.STREAM);
|
socket = new Socket(AddressFamily.UNIX, SocketType.STREAM);
|
||||||
socket.connect(new UnixAddress(socketFile));
|
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;
|
||||||
return socket;
|
return socket;
|
||||||
|
|
|
@ -42,4 +42,8 @@ string generateSocketName()
|
||||||
"dcd.socket");
|
"dcd.socket");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
assert(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue