Sending message from server to client when web socket is opened.
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- python
- Ambito
- backend, networking
Direzione di ricerca
Start with the extended chat example and trace ChatWebSocketHandler.opened(), including the direct send and the websocket-broadcast publication. Check how the WebSocketPlugin pool handles a newly opened connection; done means a client receives the initial server message without the socket being terminated.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Gang:
I'm working with the extended chat example (works great out of the box), and trying to send a message from the server to the client when the web socket is initially opened:
class ChatWebSocketHandler(WebSocket):
def opened(self):
cherrypy.engine.publish('add-client', self.username, self)
self.send("Hello, World!")
However, this causes the web socket to be terminated. I've also tried publishing the message:
class ChatWebSocketHandler(WebSocket):
def opened(self):
cherrypy.engine.publish('add-client', self.username, self)
cherrypy.engine.publish("websocket-broadcast", "Hello, World!")
... which doesn't terminate the web socket, but doesn't send the message to the newly-connected client either (I assume this is because the broadcast is going out before the handler has been transferred to the WebSocketPlugin pool).
I'm looking to use web sockets for purely one-way publishing of a data feed from server to client(s), so this seems like a pretty basic use-case. What am I missing?
Thanks in advance,
Tim
- Lingua principale
- Python
- Stelle
- 1.1k
- Fork
- 284
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Lawouach/WebSocket-for-Python
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
Lawouach/WebSocket-for-Python#300 ·
-
This project is not well maintained so be very very very patient!Forse di nuovo libera @Lawouach l’ha presa 663 giorni fa e non c’è nessuna pull request aperta. Apertaquestion
Lawouach/WebSocket-for-Python#297 · 2 commenti · 1 assegnatario ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 20/100
Lawouach/WebSocket-for-Python#296 ·
-
Make the codes python 3 compatibleForse di nuovo libera @auvipy l’ha presa 1070 giorni fa e non c’è nessuna pull request aperta. Aperta
Lawouach/WebSocket-for-Python#280 · 1 commento · 1 assegnatario ·
-
Setup new CIForse di nuovo libera @auvipy l’ha presa 1241 giorni fa e non c’è nessuna pull request aperta. Aperta
Lawouach/WebSocket-for-Python#275 · 1 assegnatario ·
Tutte le issue di Lawouach/WebSocket-for-Python
Issue simili
-
[Bug]: Streamed /v1/chat/completions sends unredacted agent error text (keys) in the final chunkForse già presa @rodricksz4h5 l’ha presa oggi. Apertaarea/streaming comp/gateway P2 type/security
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
NousResearch/hermes-agent#138245 ·
I maintainer di solito rispondono entro 1 giorno
-
[oblt-aw][autodoc] Update user onboarding guide for mandatory trigger CODEOWNERS stepForse già presa @github-actions l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
correction metadata
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 68/100
acl-org/acl-anthology#10378 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
cloudtrail_multi_region_enabled_logging_management_events fails when the advanced event selector has a custom nameForse già presa @12YYCCYY16 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
prowler-cloud/prowler#13033 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
graygarbage/HermesKey#23 ·