-
Notifications
You must be signed in to change notification settings - Fork 164
Serving only WS: disconnected immediately #44
Comments
@mariotti please, format your snippet and add invocation example. Respect time of other people. Thanks |
@oblalex I am very sorry, formatted! I was trying but got troubles and had to leave the keyboard. Came to my mind a possible problem, does the client need to start the exchange? Like sending a first message like "ready to receive". |
Solved part of the problem, I mean part of mine ;) , but I am not sure about the actual behaviour of flask-sockets. This snippet works:
But wait... the client now is sending a first message to the server, even if it doesn't get read. Once opened a ws connection, is it possible to start with just the server sending data? This in relation to my last comment. |
From this document it seems that the server can start sending data. Quote: " |
I am trying to serve on websocket only websockets. The code looks like this:
Or very close.
The js code gets connected and immediately disconnected.
The /wscrd route is never hit.
The js code is very plain.
Please note that the content of the loop
while True:
had many different versions... a kind of trial and error .. this is just one. But it never gets called anyway.
I add the js code for refs:
On the js client side I see the 2 alert: "On_open" and "On_close".
The text was updated successfully, but these errors were encountered: