Skip to content

Added an easy to use WebSocket handler AsyncWebSocketMessageHandler with an example#144

Merged
mathieucarbou merged 1 commit intomainfrom
ws
Apr 8, 2025
Merged

Added an easy to use WebSocket handler AsyncWebSocketMessageHandler with an example#144
mathieucarbou merged 1 commit intomainfrom
ws

Conversation

@mathieucarbou
Copy link
Copy Markdown
Member

@mathieucarbou mathieucarbou commented Apr 4, 2025

This PR is a proposal to add an easier to use WebSocket handler for unfragmented messages, which is 90% of the use cases. The current WebSocket API is complex to use, I think this one will help a lot.

@vortigont
Copy link
Copy Markdown

that's nice indeed! It's not common to implement reassembly logic for incoming messages for users.
One though on this - maybe have one more error callback to let user know that fragmented message has been received/discarded?

@mathieucarbou
Copy link
Copy Markdown
Member Author

mathieucarbou commented Apr 6, 2025

that's nice indeed! It's not common to implement reassembly logic for incoming messages for users. One though on this - maybe have one more error callback to let user know that fragmented message has been received/discarded?

Ah yes, good idea!
Actually, if final is false and there is not 1 frame, I could add a callback that will received all fragments... Will improve. This why, this will be a generic solution for everybody.

@mathieucarbou mathieucarbou marked this pull request as draft April 6, 2025 07:44
@mathieucarbou mathieucarbou marked this pull request as ready for review April 7, 2025 23:19
@mathieucarbou mathieucarbou force-pushed the ws branch 2 times, most recently from e6a43c5 to beb309b Compare April 8, 2025 06:33
@mathieucarbou mathieucarbou merged commit 8d712ea into main Apr 8, 2025
30 checks passed
@mathieucarbou mathieucarbou deleted the ws branch April 8, 2025 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants