BetaRavener / upy-websocket-server

Micropython (ESP8266) websocket server implementation.
MIT License
80 stars 24 forks source link

State is always 3 #13

Closed Piechota closed 1 year ago

Piechota commented 4 years ago

I am running webSocket server on esp8266. On browser I connected to it with javascript. State of webSocket on esp8266 is always 3, so _check_socket_state closes it. When closing tab with website, state changes to 4 which isn't listed here: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/readyState

When _check_socket_state check to 4 it doesn't react to closing webSocket in javascript.

It happens also with websocket_demo.py

ryaowe commented 1 year ago

It looks like the "PEER_CLOSED" state was changed from 3 to 4 since this was last udpated: https://github.com/micropython/micropython/commit/29da9f06709df77d15437b67db5978ecafcccaef