What does remainingBytes
inside of handleFragment
represent?
#1635
-
Perhaps naively, I thought it was the amount of bytes to expect for a given message across all of its continuation frames. However that doesn't seem to always be the case. If I receive a chunk from the network stack that contains both a binary and continuation message, then they will get passed separately into
In other words, we only truly have all the bytes once fin = 1 AND remainingBytes == 0 (although fin = 1 and remainingBytes > 0 I don't know what to do). Is this accurate? EDIT I suppose that it would still happen even if it weren't in the same call to consume. I suppose it is impossible to know how many bytes are left since the next message might not have even arrived yet. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I don't remember but I think it is how many bytes remains of this fragment. |
Beta Was this translation helpful? Give feedback.
-
You have 3 levels of abstraction: TCP segment, WebSocket fragment, WebSocket message. Many TCP segments can make up 1 WebSocket fragment. Many WebSocket fragments can make up 1 WebSocket message. I think. Can't remember. |
Beta Was this translation helpful? Give feedback.
I don't remember but I think it is how many bytes remains of this fragment.