Skip to content

Commit

Permalink
mini fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LagradOst committed Oct 30, 2024
1 parent 6a1e2be commit 6193e27
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,25 @@ class WebsocketClient(profile: Profile) : AbstractClient(profile) {

override fun onClosed(webSocket: WebSocket, code: Int, reason: String) {
closed = true
pending = false
Log.i(TAG, "onClosed code = $code reason = $reason")
super.onClosed(webSocket, code, reason)
}

override fun onClosing(webSocket: WebSocket, code: Int, reason: String) {
pending = false
Log.i(TAG, "onClosing code = $code reason = $reason")
super.onClosing(webSocket, code, reason)
}

override fun onFailure(webSocket: WebSocket, t: Throwable, response: Response?) {
pending = false
Log.i(TAG, "onFailure t = $t")
super.onFailure(webSocket, t, response)
}

override fun onMessage(webSocket: WebSocket, text: String) {
pending = false
scope.launch {
tryParseJson<SmallJsonResponse>(text)?.let { jsonResponse ->
pendingMutex.withLock {
Expand Down

0 comments on commit 6193e27

Please sign in to comment.