Explorar o código

ignore SIGPIPE on recv

Ted Goddard %!s(int64=8) %!d(string=hai) anos
pai
achega
0e08ca944c
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      Sources/Socket.swift

+ 1 - 1
Sources/Socket.swift

@@ -113,7 +113,7 @@ open class Socket: Hashable, Equatable {
     
     open func read() throws -> UInt8 {
         var buffer = [UInt8](repeating: 0, count: 1)
-        let next = recv(self.socketFileDescriptor as Int32, &buffer, Int(buffer.count), 0)
+        let next = recv(self.socketFileDescriptor as Int32, &buffer, Int(buffer.count), Int32(MSG_NOSIGNAL))
         if next <= 0 {
             throw SocketError.recvFailed(Errno.description())
         }