python-websocket-server icon indicating copy to clipboard operation
python-websocket-server copied to clipboard

Single client disconnection

Open Tyris0001 opened this issue 3 years ago • 2 comments

I do have reason to believe that this works.

Tyris0001 avatar Oct 12 '22 21:10 Tyris0001

Thanks for this. However some refactoring will be required before I'll be able to merge this.

Namely there's two main issues:

  1. There's some discussion of having a dictionary of clients (https://github.com/Pithikos/python-websocket-server/issues/66). That will avoid unnecessary loops.
  2. I try to avoid introducing new functions if it can be done with existing ones. I think a better implementation would be to change the existing methods to simply take clients as either a list of client_id or client. That will cover more arbitrary cases (e.g. closing 2 or 3 clients) without changing the API that much. So by default all clients are disconnected unless user specifies specific clients.

Pithikos avatar Oct 13 '22 08:10 Pithikos

Thanks for this. However some refactoring will be required before I'll be able to merge this.

The inability to disconnect a specific client by id is a massive miss here and seriously hobbles the utility of this library.

jason-c-child avatar May 03 '23 21:05 jason-c-child