Closed
Description
Motivation:
Current WebSocket API has many limitations:
- It's not possible to be notified of received fragmented frames, they are always aggregated
- It’s not possible to specify extension bits when sending a frame
- The API for being notified of write completion is cumbersome
- There are tons of different interfaces to be notified of the different types of frames
- Method names are not aligned between
WebSocket
andWebSocketListener
- There are 2 onClose listeners, the default one doesn't expose the code and reason
Modifications:
- Add a new
aggregateWebSocketFrameFragments
config param, defaulting to true. When false, fragmented frames are not aggregated. DropWebSocketByteFragmentListener
andWebSocketTextFragmentListener
and addfinalFragment
andrsv
parameters toWebSocketListener
- Provide a complete set of send methods on
WebSocket
supportingrsv
and fragmentation/continuation frame. - Have send methods return the Netty future so users can register listeners
- Drop
WebSocketTextListener
,WebSocketByteListener
,WebSocketPingListener
andWebSocketPongListener
and add default methods onWebSocketListener
. DropDefaultWebSocketListener
. - Rename all methods to
sendXXXFrame
andonXXXFrame
- Drop
WebSocketCloseCodeReasonListener
and changeWebSocketListener#onClose
to notify with code and reason.