-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: socket/channel closed detection #337
Conversation
On further investigation, I think I know a potential way to sever connections. We would need a new signal type: And in the signaling server topologies, the peer disconnection could be handled: This would require we maintain ownership of the That's not currently possible because we split the websocket into a Sink and a Stream, and I'm not well versed enough to know what the correct way to proceed. Do we "reunite them"? Do we only need to drop the |
@johanhelsing @garryod thoughts? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm on board with the direction, would be good to see a bit more granularity for the socket methods
Why does signaling need to be involved in this? couldn't the server socket just close the connection? |
That would be good, but I can't find out how to accomplish closing the socket for a specific peer. Any ideas @johanhelsing ? |
What's the problem? Wouldn't |
So, for I'm just unsure how it should be implemented. The problems I'm facing are:
|
@johanhelsing Updated to detect is channels and sockets are closed, but removed the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a good start for proper disconnection handling :)
Just update the doc comment examples so they use the API they're documenting, and this is good to merge.
Btw, I think socket.any_closed() is probably good enough, change it if you like.
Co-authored-by: Johan Klokkhammer Helsing <[email protected]>
Co-authored-by: Johan Klokkhammer Helsing <[email protected]>
The logic to close and check sockets/channels if they are closed.
One thing is noticeably absent: How do we disconnect a specific peer?
I have a client/server topology, and I need a server socket to kick specific clients under certain conditions.
Closes #286