Skip to content

onBinary Usage? #79

@xanderdunn

Description

@xanderdunn

Ubuntu 18.04, websocket-kit 2.1.1

Swift for Tensorflow 0.10

$ which swift
home/xander/swift-tensorflow-RELEASE-0.10-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift
$ swift --version
Swift version 5.3-dev (LLVM 55d27a5828, Swift 6a5d84ec08)
Target: x86_64-unknown-linux-gnu

I have been successfully using the onText callback to parse the messages my web socket client receives. However, when I replace this with onBinary, I never receive anything. It's never called. I expected onBinary would be called with the same data simply as a ByteBuffer rather than first decoding it to a String. What is the expected usage of onBinary? If this is not a bug, in what cases is onBinary expected to be called?

I would prefer to access the data via the original ByteBuffer rather than as a converted String because I will have to convert a String back to bytes/Data to do my decoding.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions