File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Sources/FoundationNetworking/URLSession Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -754,7 +754,9 @@ open class URLSessionWebSocketTask : URLSessionTask {
754754 pongReceiveHandler ( error)
755755 }
756756 } else {
757- pongReceiveHandler ( POSIXError ( . ENOTCONN) )
757+ let disconnectedError = URLError ( _nsError: NSError ( domain: NSURLErrorDomain,
758+ code: NSURLErrorNetworkConnectionLost) )
759+ pongReceiveHandler ( disconnectedError)
758760 }
759761 }
760762 }
@@ -782,7 +784,8 @@ open class URLSessionWebSocketTask : URLSessionTask {
782784
783785 self . closeCode = code
784786 self . closeReason = reason
785- self . taskError = POSIXError ( . ENOTCONN)
787+ self . taskError = URLError ( _nsError: NSError ( domain: NSURLErrorDomain,
788+ code: NSURLErrorNetworkConnectionLost) )
786789 self . closeMessage = ( code, reason ?? Data ( ) )
787790 self . doPendingWork ( )
788791 }
You can’t perform that action at this time.
0 commit comments