Rohan Maity
02/25/2025, 7:10 PM"Connection" to "Upgrade",
"Sec-WebSocket-Extensions" to "permessage-deflate",
"Upgrade" to "websocket",
"Sec-WebSocket-Version" to "13",
"Sec-WebSocket-Key" to secWebSocketKeyValue
Rohan Maity
02/25/2025, 7:11 PMRohan Maity
02/25/2025, 7:26 PMjw
02/25/2025, 7:31 PMRohan Maity
02/25/2025, 7:41 PMRohan Maity
02/25/2025, 7:43 PMrequestBuilder.headers(httpHeadersProvider.get().toHeaders())
I did not know headers()
will replace all headers. Then I thought it does not have the verb so though to check this and it was replacing all headers including websocket ones
Now its working when I am adding headers in a loopRohan Maity
02/25/2025, 7:53 PMEOFException
when I manually call webSocket.disconnect()
should not Okhttp invoke onClosed
callback instead of onFailure
?jessewilson
02/25/2025, 10:56 PMjessewilson
02/25/2025, 10:57 PMRohan Maity
02/26/2025, 5:34 AMwebSocket?.close(DISCONNECT_CODE, DISCONNECT_REASON)
// Disconnect codes
DISCONNECT_CODE = 1000
DISCONNECT_REASON = "Normal closure"
I expected that I will get a callback in onClosed
but I get the callback in onFailure
with EODException
Rohan Maity
02/26/2025, 6:03 AMwebSocket.close()
returns true but somehow I get the callback in onFailure
with this
I am on 4.9.3 okhttp version
Exception " java.io.EOFException
stacktrace: java.io.EOFException
at okio.RealBufferedSource.require(RealBufferedSource.kt:202)
at okio.RealBufferedSource.readByte(RealBufferedSource.kt:212)
at okhttp3.internal.ws.WebSocketReader.readHeader(WebSocketReader.kt:119)
at okhttp3.internal.ws.WebSocketReader.processNextFrame(WebSocketReader.kt:102)
at okhttp3.internal.ws.RealWebSocket.loopReader(RealWebSocket.kt:293)
at okhttp3.internal.ws.RealWebSocket$connect$1.onResponse(RealWebSocket.kt:195)
at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
In the real websocket class, I see this where the code failsjessewilson
02/26/2025, 11:44 AMRohan Maity
02/26/2025, 11:45 AMjessewilson
02/26/2025, 11:47 AM