Skip to content

Commit

Permalink
Minor formatting errors as a result of the merge.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill Abt committed Aug 11, 2016
1 parent dba96ab commit 3c6b4fc
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions Sources/Socket.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1996,8 +1996,7 @@ public class Socket: SocketReader, SocketWriter {
///
/// - Returns: Integer representing the number of bytes written.
///
@discardableResult
public func write(from buffer: UnsafePointer<Void>, bufSize: Int) throws -> Int {
@discardableResult public func write(from buffer: UnsafePointer<Void>, bufSize: Int) throws -> Int {

// Make sure the buffer is valid...
if bufSize == 0 {
Expand Down Expand Up @@ -2050,8 +2049,10 @@ public class Socket: SocketReader, SocketWriter {
#endif
}
if s <= 0 {

if errno == EAGAIN && !isBlocking {
// We have written out as much as we can

// We have written out as much as we can...
return sent
}

Expand All @@ -2069,8 +2070,7 @@ public class Socket: SocketReader, SocketWriter {
///
/// - Returns: Integer representing the number of bytes written.
///
@discardableResult
public func write(from data: NSData) throws -> Int {
@discardableResult public func write(from data: NSData) throws -> Int {

// If there's no data in the NSData object, why bother? Fail silently...
if data.length == 0 {
Expand All @@ -2087,8 +2087,7 @@ public class Socket: SocketReader, SocketWriter {
///
/// - Returns: Integer representing the number of bytes written.
///
@discardableResult
public func write(from data: Data) throws -> Int {
@discardableResult public func write(from data: Data) throws -> Int {

// If there's no data in the Data object, why bother? Fail silently...
if data.count == 0 {
Expand All @@ -2108,8 +2107,7 @@ public class Socket: SocketReader, SocketWriter {
///
/// - Returns: Integer representing the number of bytes written.
///
@discardableResult
public func write(from string: String) throws -> Int {
@discardableResult public func write(from string: String) throws -> Int {

return try string.nulTerminatedUTF8.withUnsafeBufferPointer() { (buffer: UnsafeBufferPointer) -> Int in

Expand Down

0 comments on commit 3c6b4fc

Please sign in to comment.