adds NIOWebSocketFrameAggregator to buffer fragmented WS frames #50
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation:
We want support frame fragmentation at the WebSocket level
Modifications:
add NIOWebSocketFrameAggregator to channel pipeline in front of our own channel handlers
Result:
Fragmented WebSocket Frames are now supported.
Discussion
What are good default values for
minNonFinalFragmentSize
andmaxAccumulatedFrameCount
for WebSocket?The equivalent of
minNonFinalFragmentSize
in RSocket would be 64 bytes but I don't know if this is appropriate for WebSocket as well.I have set
minNonFinalFragmentSize
by default to0
andmaxAccumulatedFrameCount
toInt.max
for now.minNonFinalFragmentSize
andmaxAccumulatedFrameCount
are part ofWSTransport
and notClientConfiguration
because they are specific to WebSocket. I kind of want them to be part ofClientConfiguration
. I initially thought that we could just add these properties toClientConfiguration.Fragmentation
and even use the same values for WebSocket fragmentation and RSocket fragmentation. But that would mean one can not configure fragmentation separately for WebSocket and for RSocket... Maybe that's good thing, less configuration one has to worry about is in general a good thing. However, I can't say for sure that RSocket fragmentation and WebSocket fragmentation should always have the same buffer limits.