All Questions
Tagged with python-asyncio websocket
390 questions
0
votes
1
answer
26
views
Running WebSocket server and separate while loop simultaneously
The following code is for a RC flight controller based around an Raspberry Pi (Zero 2W). The purpose of the code is to receive input controls from my Iphone while also managing a few PID controllers ...
0
votes
1
answer
89
views
How to set an end time for a LiveKit room and send a warning message 1 minute before disconnecting using Python?
I'm working with LiveKit and a multimodal agent in Python for a voice-based interview session. I'd like to implement the following:
Automatically disconnect the agent at a specific end time.
Send a &...
0
votes
0
answers
25
views
WebSocket Server in Python Not Receiving All Messages While Node.js Does
I am running a WebSocket server behind Nginx, and I have two different implementations: one in Node.js and one in Python. The Node.js WebSocket server receives all messages correctly, but the Python ...
0
votes
1
answer
70
views
Unable to catch asyncio.IncompleteReadError for websocket server
I am currently working on a websocket server to allow communication between 2 computers, and I'm coding the communication between PC and server. I made a command to stop the server remotely, but when ...
1
vote
1
answer
104
views
How to make a non-blocking Websocket endpoint in FastAPI? [duplicate]
I'm fairly new to async in Python. Currently I'm trying to implement a Websocket endpoint with FastAPI that performs a long-running task. The following code is used:
@router.websocket("/ws/...
0
votes
0
answers
344
views
Websocket with Python error: [WinError 121] The semaphore timeout period has expired
EDIT: I am providing the official code for the websocket asyncio server example from python websocket webpage: https://websockets.readthedocs.io/en/stable/index.html
The [WinError 121] appears when a ...
0
votes
1
answer
217
views
Cannot access path in websockets.serve handler
I cannot find a way to access the path of a websocket connection, docs say Receiving the request path in the second parameter of connection handlers is deprecated.
python version: 3.12.6
websockets ...
1
vote
0
answers
22
views
WebSockets message sending order
I am making blocking requests calls in a WebSockets server just to test a thing out, but I experienced a weird behavior.
There is one client connection, sending a single message. The message is ...
0
votes
0
answers
30
views
Invalid session EUnQ7_jkg_pu1UqSAAAE (further occurrences of this error will be logged with level INFO)
I am facing this error message in my websocket server application.
The server has 2 main tasks. One of them contuniously listens to an SQS queue, and the other one gets some data from redis and ...
0
votes
0
answers
126
views
Python 3.13 with Websockets and asyncio - how to close connection properly
I am using python 3.13 with the rewritten asyncio and library websockets to download prices.
The issue is once the data is received the websocket connection is not closed.
Here is the code snippet:
...
0
votes
1
answer
70
views
Is there an issue if two asyncio tasks, one reads and one writes, uses one single websocket at the same time?
I have the following simplified code:
import asyncio
import websockets
async def read_from_ws(websocket):
async for message in websocket:
print(f"Received message: {message}")
...
1
vote
0
answers
53
views
Asyncio.ws_connect not receiving a connection closure message
async def _connect_session(self):
websocket_url, headers, cookies = self._get_connect_data()
try:
async with aiohttp.ClientSession(cookies=cookies) as session:
logger.debug(...
0
votes
1
answer
90
views
Passing websocket data to another python program
I have a fairly typical websocket-client program that reads from the wss server.
import asyncio
import json
import websockets
api_data = {
"type": "subscribe",
&...
0
votes
0
answers
44
views
Live data dictonary on Websocket Server hosted GCP App engine behaves unusually
So I have a web socket server hosted on GCP app engine, In the server I have a global dict which i keep storing to keep a track of connections.
The problem is even with so many logs its hard to keep ...
0
votes
1
answer
42
views
Asyncio stop waiting for socket
I'm trying to write a code in micropython for ESP32.
ESP32 need to write in LCD Display by example every 10 seconds, and too response in one web server. But when go to web server code section, it stop,...