@@ -1996,8 +1996,7 @@ public class Socket: SocketReader, SocketWriter {
19961996 ///
19971997 /// - Returns: Integer representing the number of bytes written.
19981998 ///
1999- @discardableResult
2000- public func write( from buffer: UnsafePointer < Void > , bufSize: Int ) throws -> Int {
1999+ @discardableResult public func write( from buffer: UnsafePointer < Void > , bufSize: Int ) throws -> Int {
20012000
20022001 // Make sure the buffer is valid...
20032002 if bufSize == 0 {
@@ -2050,8 +2049,10 @@ public class Socket: SocketReader, SocketWriter {
20502049 #endif
20512050 }
20522051 if s <= 0 {
2052+
20532053 if errno == EAGAIN && !isBlocking {
2054- // We have written out as much as we can
2054+
2055+ // We have written out as much as we can...
20552056 return sent
20562057 }
20572058
@@ -2069,8 +2070,7 @@ public class Socket: SocketReader, SocketWriter {
20692070 ///
20702071 /// - Returns: Integer representing the number of bytes written.
20712072 ///
2072- @discardableResult
2073- public func write( from data: NSData ) throws -> Int {
2073+ @discardableResult public func write( from data: NSData ) throws -> Int {
20742074
20752075 // If there's no data in the NSData object, why bother? Fail silently...
20762076 if data. length == 0 {
@@ -2087,8 +2087,7 @@ public class Socket: SocketReader, SocketWriter {
20872087 ///
20882088 /// - Returns: Integer representing the number of bytes written.
20892089 ///
2090- @discardableResult
2091- public func write( from data: Data ) throws -> Int {
2090+ @discardableResult public func write( from data: Data ) throws -> Int {
20922091
20932092 // If there's no data in the Data object, why bother? Fail silently...
20942093 if data. count == 0 {
@@ -2108,8 +2107,7 @@ public class Socket: SocketReader, SocketWriter {
21082107 ///
21092108 /// - Returns: Integer representing the number of bytes written.
21102109 ///
2111- @discardableResult
2112- public func write( from string: String ) throws -> Int {
2110+ @discardableResult public func write( from string: String ) throws -> Int {
21132111
21142112 return try string. nulTerminatedUTF8. withUnsafeBufferPointer ( ) { ( buffer: UnsafeBufferPointer ) -> Int in
21152113
0 commit comments