mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-14 15:23:27 +00:00
Enable SO_NOSIGPIPE for sockets on OS X.
This commit is contained in:
@@ -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.
|
||||
##
|
||||
|
||||
Reference in New Issue
Block a user