Check if tcpip connection was closed by remote machine

1 vue (au cours des 30 derniers jours)
Daniel Hähnke
Daniel Hähnke le 22 Août 2018
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 :)

Réponses (0)




Community Treasure Hunt

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

Start Hunting!

Translated by