Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending binary messages refuse to work with specific char suite. #141

Closed
Dean151 opened this issue Jul 16, 2022 · 2 comments
Closed

Sending binary messages refuse to work with specific char suite. #141

Dean151 opened this issue Jul 16, 2022 · 2 comments

Comments

@Dean151
Copy link

Dean151 commented Jul 16, 2022

I saw about sending binary messages in issue #123.

But it works only with specific amount of bytes:

$will_work = hex2bin('9da11441424331323334353637383901d00100');
$will_work = hex2bin('9da11441424331323334353637383901d001000000');
$will_work = hex2bin('9da11441424331323334353637383901d00100000000');
$will_work = hex2bin('9da11441424331323334353637383901d0010001');
$wont_work = hex2bin('9da11441424331323334353637383901d0010000');
$conn->send(new Frame($will_work, true, Frame::OP_BINARY)); // OK
$conn->send(new Frame($wont_work, true, Frame::OP_BINARY)); // Ratchet detected an invalid UTF-8 payload

Something might be wrong.
And it's not like I can change the payload, I'm simulating the behavior of a shitty pet feeder machine that send exactly this data via a websocket.

Any insight on the issue, and maybe how to fix it?

@Dean151
Copy link
Author

Dean151 commented Jul 16, 2022

Seems like the problem is with the response I send. I close this issue. Sorry!

@Dean151 Dean151 closed this as completed Jul 16, 2022
@Dean151
Copy link
Author

Dean151 commented Jul 16, 2022

I confirm that the issue was that on my side. The server was not passing the OP_Binary constant correctly. All working now. Thanks!

(And the issue was only for my string, because I respond only when I recognize the data).
It all makes sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant