mirror of
https://github.com/espressif/openthread.git
synced 2026-08-27 04:19:54 +00:00
When a simulated node restarts (e.g. during `factoryreset`), the child process re-executes itself via `execvp`, disconnecting its UNIX domain socket connection to the virtual-time simulator. If `VirtualTime._send_message()` attempts to send an event before the socket disconnection event has been processed by `selectors`, `sock.send()` raises `BrokenPipeError` or `ConnectionResetError`, even though the node is marked as temporarily offline in `_maybeoff_ports` (via `maybeoff=True`). This commit catches `BrokenPipeError` and `ConnectionResetError` in `VirtualTime._send_message()`, verifying that the destination port is present in `_maybeoff_ports` and skipping delivery cleanly.