onBinaryMessage

suspend fun onBinaryMessage(bytes: ByteArray, isLast: Boolean = true)(source)

Callback for binary messages (potentially partial frames).

The given bytes array can be reused right after this method returns.

If isLast is true, the web socket frame is considered complete and the full (aggregated) message is sent to the incomingFrames flow as a WebSocketFrame.Binary frame. Otherwise, the message is simply appended to a buffer and nothing happens in the incomingFrames flow. More partial messages are expected in this case.