android-websockets icon indicating copy to clipboard operation
android-websockets copied to clipboard

"Expected non-final packet" on fragmented messages

Open jketterl opened this issue 12 years ago • 1 comments

I'm having a little trouble receiving big messages from a node.js websocket server (if it's of any use, the server side uses this library). The connection seems to close with the "Expected non-final packet" exception every time a text message that can't be contained in a single frame is received.

I've took some time and read the code and the ietf rfc (this version here) and from what i see, it seems your code is choking on the initial frame that is supposed to start the fragmented message because it believes the message to be a continuation frame.

I've changed the list of opcodes allowed for fragmentation (FRAGMENTED_OPCODES) to only contain OP_CONTINUATION and it seems to work now. i am however unsure wether this is the correct fix for the situation at hand, so i'd like to hear your opinions on that.

jketterl avatar Aug 06 '12 10:08 jketterl

+1

max-mapper avatar Aug 11 '12 21:08 max-mapper