Explorar o código

Use send with MSG_NOSIGNAL rather than write

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

+ 1 - 1
Sources/Socket+File.swift

@@ -19,7 +19,7 @@ import Foundation
             }
             var writeCounter = 0
             while writeCounter < readResult {
-                let writeResult = write(target, &buffer + writeCounter, readResult - writeCounter)
+                let writeResult = send(target, &buffer + writeCounter, readResult - writeCounter, Int32(MSG_NOSIGNAL))
                 guard writeResult > 0 else {
                     return Int32(writeResult)
                 }