Remove redundant as, change method name

This commit is contained in:
Erik Little 2017-09-06 21:08:00 -04:00
parent 3eb7edc37c
commit 5470fb6926
No known key found for this signature in database
GPG Key ID: 4930B7C5FBC1A69D

View File

@ -263,7 +263,7 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll
if forceWebsockets { if forceWebsockets {
polling = false polling = false
websocket = true websocket = true
createWebsocketAndConnect() createWebSocketAndConnect()
return return
} }
@ -318,9 +318,9 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll
return (urlPolling.url!, urlWebSocket.url!) return (urlPolling.url!, urlWebSocket.url!)
} }
private func createWebsocketAndConnect() { private func createWebSocketAndConnect() {
ws?.delegate = nil ws?.delegate = nil // TODO this seems a bit defensive, is this really needed?
ws = WebSocket(url: urlWebSocketWithSid as URL) ws = WebSocket(url: urlWebSocketWithSid)
if cookies != nil { if cookies != nil {
let headers = HTTPCookie.requestHeaderFields(with: cookies!) let headers = HTTPCookie.requestHeaderFields(with: cookies!)
@ -475,7 +475,7 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll
} }
if !forcePolling && !forceWebsockets && upgradeWs { if !forcePolling && !forceWebsockets && upgradeWs {
createWebsocketAndConnect() createWebSocketAndConnect()
} }
sendPing() sendPing()