Skip to content
Advertisement

Tag: websocket

How to detect closed websocket in asyncio.gather(*tasks)

I have a list of asyncio tasks which contains with connecting,handshaking and receiving data from a websocket. This process is running correctly but sometimes the connection of one of the websocket (or maybe all of them) is closed. How can I detect and make a new conncetion to the closed one? Here is the code which I use: According to

Use the same websocket connection in multiple asynchronous loops (Python)

I am running two loops asynchronously, and want both to have access to the same websocket connection. One function periodic_fetch() fetches some data periodically (every 60 seconds) and sends a message to the websocket if a condition is met. The other retrieve_websocket() receives messages from the websocket and perform some action if a condition is met. As of now, I

Push live updates through Socket

I need to pass live data from a python script to my server (made with FastApi) and from this server I need to pass all of them to a client (made with Angular). Currently I’m doing Http PUT requests from my script and then I’m using Websocket to pass the updates to the client. The problem is that whenever my

Websocket Client not receiving any messages

I have Python client which opens a websocket connection to a server and subscribes to particular topic using STOMP protocol, subscription goes just fine as i see on the server all is fine. However, When the server publishes a few messages the client does not receive any. Here are the codes used: Client Code server uses to publish the message:

Advertisement