Skip to content

add WebSocket endpoint support#66

Open
heshammahamed wants to merge 2 commits into
mainfrom
Add/websocket_support
Open

add WebSocket endpoint support#66
heshammahamed wants to merge 2 commits into
mainfrom
Add/websocket_support

Conversation

@heshammahamed

Copy link
Copy Markdown
Contributor

No description provided.

* find all classes annotated with wsEndpoint modifier
* validate and extract the four handler functions (onConnect, onReady, onData, onClose)
* extract the URI from the modifier params to pass to setWebSocketHandler
* add wsConnection class with isDead flag and guarded send/close methods
* implement constructSocketConnectHandler to call user onConnect with raw connection ptr
* implement constructSocketReadyHandler to look up wsConnection and call user onReady
* implement constructSocketDataHandler with isBinary flag derived from opcode
* implement constructSocketCloseHandler to nullify connection, call user onClose, then remove from map
* add socketConnections map to track active connections by ptr[Http.Connection]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant