Enable SO_NOSIGPIPE for sockets on OS X.

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

View file

@ -205,6 +205,10 @@ proc newSocket*(fd: SocketHandle, domain: Domain = AF_INET,
if buffered: if buffered:
result.currPos = 0 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 = proc newSocket*(domain, sockType, protocol: cint, buffered = true): Socket =
## Creates a new socket. ## Creates a new socket.
## ##