Skip to content

rpcserver: Detect disconnect of ws clients.#3031

Merged
davecgh merged 1 commit intodecred:masterfrom
davecgh:rpcserver_detect_ws_disconnect
Nov 30, 2022
Merged

rpcserver: Detect disconnect of ws clients.#3031
davecgh merged 1 commit intodecred:masterfrom
davecgh:rpcserver_detect_ws_disconnect

Conversation

@davecgh
Copy link
Copy Markdown
Member

@davecgh davecgh commented Nov 30, 2022

The recent commit that converted the websocket handler to use contexts in PR #3026 failed to account for the request context not being closed when the connection is closed unlike the case in the HTTP path since the websocket hijacks the connection.

This ensures the Run method terminates on websocket disconnection by selecting across both the context and the quit channel that is closed when disconnect is called.

The recent commit that converted the websocket handler to use contexts
failed to account for the request context not being closed when the
connection is closed unlike the case in the HTTP path since the
websocket hijacks the connection.

This ensures the Run method terminates on websocket disconnection by
selecting across both the context and the quit channel that is closed
when disconnect is called.
@davecgh davecgh added this to the 1.8.0 milestone Nov 30, 2022
@davecgh davecgh merged commit bb14350 into decred:master Nov 30, 2022
@davecgh davecgh deleted the rpcserver_detect_ws_disconnect branch November 30, 2022 18:39
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.

3 participants