user1277170
user1277170

Reputation: 3227

Chrome WebSocket Stops Receiving

When I send

'\x81\x04pong'

to the websocket, it receives fine.

When I send

'\x81\x7e\xd0\x00abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklm nopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO PQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'

it doesn't receive, nor does it receive any further frames.

I think the problem might be in the second, third or fourth byte. Can anyone see what I'm doing wrong?

Upvotes: 0

Views: 145

Answers (1)

user1277170
user1277170

Reputation: 3227

The length, as specified in the third and fourth byte is little-endian, whereas it should be big-endian. The correct frame is '\x81\x7e\x00\xd0abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklm nopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO PQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'

Upvotes: 1

Related Questions