You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am new to WebSocket and Swift, and there is a high chance that I am wrong.
I communicate with a WebSocket server that randomly sends ping as an Opcode frame to the client and expects a pong. The connection is closed immediately because the incoming ping is incorrectly handled as an unknown message. After all, the incoming Opcode has context but no data and no error; therefore, it lands in the handleUknownMessage method followed by connection close.
The following temporarily solved my problem, but I doubt it's the correct way to do it. It might help somebody to do it the right way.
Necessary update on the WebSocketMessage:
The text was updated successfully, but these errors were encountered:
I am new to WebSocket and Swift, and there is a high chance that I am wrong.
I communicate with a WebSocket server that randomly sends ping as an Opcode frame to the client and expects a pong. The connection is closed immediately because the incoming ping is incorrectly handled as an unknown message. After all, the incoming Opcode has
context
but nodata
and noerror
; therefore, it lands in thehandleUknownMessage
method followed by connection close.The following temporarily solved my problem, but I doubt it's the correct way to do it. It might help somebody to do it the right way.
Necessary update on the
WebSocketMessage
:The text was updated successfully, but these errors were encountered: