Enable SO_NOSIGPIPE for sockets on OS X.

This commit is contained in:
Dominik Picheta
2016-08-16 21:10:55 +02:00
parent f44486cc85
commit 006207742f

View File

@@ -205,6 +205,10 @@ proc newSocket*(fd: SocketHandle, domain: Domain = AF_INET,
if buffered:
result.currPos = 0
# Set SO_NOSIGPIPE on OS X.
when defined(macosx):
setSockOptInt(fd, SOL_SOCKET, SO_NOSIGPIPE, 1)
proc newSocket*(domain, sockType, protocol: cint, buffered = true): Socket =
## Creates a new socket.
##