Open waldemarmeier opened 5 years ago
Most likely we need to fix WebSocketWriter/Serializer to put zero optcode automatically so one should never put zero opcode to a frame
Also it looks like it is impossible to provide fragmented frames support in JS
Thanks for the answer. So currently, it is not possible ? Before I started implementing my client, I compared several client frameworks and I liked yours the most. Hope you can add support support for fragmented messages!
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
maxFrameSize
option is only available on incoming messages.
No user API can set the continuation opcode among continuous frames.
DefaultWebSocketSession also will not split the big frames.
There is no any workaround we can do...
Ktor Version
1.1.4
Ktor Engine Used(client or server and name)
CIO
JVM Version, Operating System and Relevant Context
Windows, JVM 8
Feedback
Hello,
I want to use to the ktor-client to send binary audio data through a websocket connection to a proprietary webservice. The documenation of this service says: "Audio is expected to be delivered at a steady rate, in reasonably sized chunks (20ms to 1s ,multiples of 20 ms recommended) in order for results to be delivered in a timely fashion"
When I cut my audio data in chunks and try to send it with the ws-client in multiple binary frames, I get the following error message: "data frames after the initial data frame must have opcode 0".
As far as I've seen, there is no way to change the opcode of a Frame, because it is set in the in the FrameType enum, so I am kind of stuck.
Is there a way to: 1) manually change the opcode of the following frames to 0 2) or some other way to send the data in chunks?
Btw, the code looks something like this: