Replies: 3 comments 16 replies
-
Thank you for trying out picows! I quickly ran through the code in on_ws_frame and noticed a couple of thing that you maybe would find interesting to change:
to make sure you client always replies to ping messages.
if you have actually observed non fin messages. Imho, it may actually suffice to just have this instead:
Notice that I also used get_payload_as_utf8_text instead of get_payload_as_bytes, as it is faster than first getting bytes and then decoding them with decode('utf8') I wish all the best with your project! |
Beta Was this translation helpful? Give feedback.
-
Extremely sorry, I made a huge mistake in subscription : Sorry again for the trouble I created because of own silly mistake.. |
Beta Was this translation helpful? Give feedback.
-
On network disconnection, it behaves differently in windows and linux. In windows (python 3.11 and 3.12), It disconnects immediately on network disconnects but in linux (Ubuntu 24.04 LTS, python 3.12.3 and 3.12.6) it shows a indefinite behavior. So I make a loop checking for pong after each ping with a timeout of 20 secs: If not received, It will disconnects itself and the retry mechanism will try to reconnect it with a gap of 1 sec: But transport.disconnect() takes a significant amount of time in between: |
Beta Was this translation helpful? Give feedback.
-
I tried implementing picows for connecting to a broker websocket. https://github.com/Tapanhaz/Shoonya-Websocket
Beta Was this translation helpful? Give feedback.
All reactions