Check if tcpip connection was closed by remote machine

1 次查看(过去 30 天)
Hello,
I'm trying to set up a communication channel between two PCs that are connected via a local network. I want either of the two machines to close the connection and try to reconnect if the connection was closed by the remote machine, i.e. when the remote ran fclose(), crashed or restarted.
The Status property of the tcpip objects doesn't help here because it still says 'Open' if the connection was closed on the other side. I could periodically use netstat and check if the TCP connection is still listed as ESTABLISHED, but I feel there must be a more elegant way to do this.
Any ideas would be appreciated :)
Daniel

回答(0 个)

产品


版本

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by