Skip to content

Commit

Permalink
Set remoteConnectionClosed = true for all ECONNRESET
Browse files Browse the repository at this point in the history
  • Loading branch information
mcfedr committed Aug 30, 2018
1 parent a4ffe7e commit 114f6b9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Sources/Socket/Socket.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3008,7 +3008,7 @@ public class Socket: SocketReader, SocketWriter {

// - Handle a connection reset by peer (ECONNRESET) and throw a different exception...
if errno == ECONNRESET {

self.remoteConnectionClosed = true
throw Error(code: Socket.SOCKET_ERR_CONNECTION_RESET, reason: self.lastError())
}

Expand Down Expand Up @@ -3139,7 +3139,7 @@ public class Socket: SocketReader, SocketWriter {

// - Handle a connection reset by peer (ECONNRESET) and throw a different exception...
if errno == ECONNRESET {

self.remoteConnectionClosed = true
throw Error(code: Socket.SOCKET_ERR_CONNECTION_RESET, reason: self.lastError())
}

Expand Down Expand Up @@ -3566,6 +3566,7 @@ public class Socket: SocketReader, SocketWriter {

case ECONNRESET:
// - Handle a connection reset by peer (ECONNRESET) and throw a different exception...
self.remoteConnectionClosed = true
throw Error(code: Socket.SOCKET_ERR_CONNECTION_RESET, reason: self.lastError())

default:
Expand Down Expand Up @@ -3635,7 +3636,7 @@ public class Socket: SocketReader, SocketWriter {

// - Handle a connection reset by peer (ECONNRESET) and throw a different exception...
if errno == ECONNRESET {

self.remoteConnectionClosed = true
throw Error(code: Socket.SOCKET_ERR_CONNECTION_RESET, reason: self.lastError())
}

Expand Down

0 comments on commit 114f6b9

Please sign in to comment.