You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,8 +47,9 @@ Updated to mist_openapi spec version 2602.1.7.
47
47
---
48
48
49
49
### 3. BUG FIXES
50
-
51
50
- Fixed `ShellSession.recv()` to gracefully handle socket timeout reset when the connection is already closed
51
+
- Fixed thread-safety (TOCTOU) race conditions in `ShellSession` by capturing WebSocket reference in local variables across `disconnect()`, `connected`, `send()`, `recv()`, and `resize()` methods
52
+
- Fixed thread-safety race condition in `_MistWebsocket.disconnect()` with local variable capture
Copy file name to clipboardExpand all lines: README.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -579,19 +579,23 @@ The package provides a WebSocket client for real-time event streaming from the M
579
579
580
580
### Connection Parameters
581
581
582
-
All channel classes accept the following optional keyword arguments to control the WebSocket keep-alive behaviour:
582
+
All channel classes accept the following optional keyword arguments:
583
583
584
584
| Parameter | Type | Default | Description |
585
585
|-----------|------|---------|-------------|
586
586
|`ping_interval`|`int`|`30`| Seconds between automatic ping frames. Set to `0` to disable pings. |
587
587
|`ping_timeout`|`int`|`10`| Seconds to wait for a pong response before treating the connection as dead. |
588
+
|`auto_reconnect`|`bool`|`False`| Automatically reconnect on transient failures using exponential backoff. |
589
+
|`max_reconnect_attempts`|`int`|`5`| Maximum number of reconnect attempts before giving up. |
590
+
|`reconnect_backoff`|`float`|`2.0`| Base backoff delay in seconds. Doubles after each failed attempt (2s, 4s, 8s, ...). Resets on successful reconnection. |
588
591
589
592
```python
590
593
ws = mistapi.websockets.sites.DeviceStatsEvents(
591
594
apisession,
592
595
site_ids=["<site_id>"],
593
-
ping_interval=60, # ping every 60 s
594
-
ping_timeout=20, # wait up to 20 s for pong
596
+
ping_interval=60, # ping every 60 s
597
+
ping_timeout=20, # wait up to 20 s for pong
598
+
auto_reconnect=True, # reconnect on transient failures
0 commit comments