I am attempting to monitor the status of a NodeJS Net::socket socket connection by periodically polling the .readyState property of the Socket client. Running the NodeJS app on Windows, this works as expected: I unplug the ethernet cable or change the remote device IP and readyState changes. Running the same NodeJS app on Linux, the readyState property remains on ‘open’ and never changes, so I can’t reliably determine if the connection is actually open or closed.
Any ideas on how to get around this, and/or a reason for it? Is there a better way to monitor connection status reliably?
Windows PC: Windows 10 Home V22H2, Node 21.7.1
Linux: Raspbian Bookworm 6.1.74-12781 on Libre AML-S905X-CC SBC, Node 21.7.1