All Questions
304 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
93
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
71
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
218
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
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
52
views
Websocket connecting only after the ayncio finish the background task [duplicate]
I have a process route in my fast api server :-
@router.post("/process")
async def handle_options(data: Dict[str, Any]):
#.... other code
asyncio.create_task(editing(videoId, values, ...
0
votes
0
answers
52
views
Python: Dispatching a function in addition to WebSocketApps
In python, I have a series of 3 WebSocketApps that all working correctly together and receiving messages, setup as follows:
ws1 = websocket.WebSocketApp("<url1>", on_open=...)
ws1....
0
votes
1
answer
34
views
Stuck in await for async.Event after event was set
I create a websocket connection using python websockets.
I define an infinite background task to listen for server messages and pass them to the handler as they come.
To subscribe to a live quote I ...
1
vote
0
answers
21
views
WebSocket connection closing unexpectedly [duplicate]
To get around the POST request timeout errors, I've implemented a websocket variant of my code (below) that would send a task client side and awaits a response from my server side (whether the task ...
0
votes
0
answers
36
views
Websocket stuck in CONNECTING readyState until ERR_CONNECTION_ABORTED error
I have a simple python Flask backend using Asyncio:
# Simplified version of backend
connectedClients = {}
async def handler(webSocket):
async for messageString in webSocket:
print(f'...