How to access other websockets at the server side with ws4py?

314 Views Asked by At

ws4py provides a WebSocket type that is supposed to provide an abstraction of the websocket that is independent of the underlying server (gevent and others)

My problem is, when using gevent at the server side there is nothing that lets me access the global container of all websockets. The Design section of the documentation here says that there is a global instance of WebSocketManager that manages the individual web socket. The call diagram on the same page implies that there is a manager instance on the server side that manages things.

I can't even write a simple chat server because I'd need to access the other sockets and write them but there is no abstraction that I could find that lets me do this. In case of gevent, I'd need to access other greenlets or websockets presented by other greenlets.

the chat example that comes with ws4py uses Cherrypy specific features which makes me think I'd have to implement a gevent specific way of doing what I want to do.

So am I missing a feature here? How does one access all websockets on the server side when a websocket has received a message when gevent is used at the server side?

0

There are 0 best solutions below