Skip to content

Commit

Permalink
Merge pull request #707 from watson-developer-cloud/update-starscream
Browse files Browse the repository at this point in the history
Update Starscream to v3.0.4
  • Loading branch information
glennrfisher authored Jan 19, 2018
2 parents 0bff48a + 9a56f1c commit 73f2e68
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "daltoniam/Starscream" "3.0.3"
github "daltoniam/Starscream" "3.0.4"
github "daltoniam/common-crypto-spm" "1.1.0"
github "daltoniam/zlib-spm" "1.1.0"
9 changes: 2 additions & 7 deletions Source/SpeechToTextV1/SpeechToTextSocket.swift
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,8 @@ internal class SpeechToTextSocket: WebSocketDelegate {
}

private func isNormalDisconnect(error: Error) -> Bool {
let error = error as NSError
let matchesDomain = (error.domain == "WebSocket")
let matchesCode = (error.code == 1000)
if matchesDomain && matchesCode {
return true
}
return false
guard let error = error as? WSError else { return false }
return error.code == Int(CloseCode.normal.rawValue)
}

internal func websocketDidConnect(socket: WebSocketClient) {
Expand Down

0 comments on commit 73f2e68

Please sign in to comment.