Reputation: 3227
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
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