I have a scenario where a network cable can become disconnected from a device. If the cable is re-connected before the watch dog timer on the device fires communication with the device will resume. However, if the connection is made after the watch dog timer has closed the connection then communication will not resume. In Purebasic I cannot detect this scenario and when I try communicating after the network connection is closed by the watch dog timer my Linux application exits without any error message. I assume that has something to do with the network connection not being valid anymore. I would have thought it would have thrown an
error but instead the application just exits.
Does anyone have any suggestions about how this could be handled so the application does not just exit without calling the error routine.
Thanks,
Simon
Linux TCP Socket Disconnection Question
Linux TCP Socket Disconnection Question
Simon White
dCipher Computing
dCipher Computing
Solved: Linux TCP Socket Disconnection Question
Hi
It turns out that the code reading the data from the connection was failing to check for the #PB_NetworkEvent_Disconnect. Once this was corrected the code worked properly and detected the closed connection.
Simon
It turns out that the code reading the data from the connection was failing to check for the #PB_NetworkEvent_Disconnect. Once this was corrected the code worked properly and detected the closed connection.
Simon
Simon White
dCipher Computing
dCipher Computing
Re: Linux TCP Socket Disconnection Question
The event "#PB_NetworkEvent_Disconnect" cannot be used to reliably detect a technical fault in the network.
As a rule, with your own protocols, you programme a life trigger and your own timeout in the server for the connected clients.
As a rule, with your own protocols, you programme a life trigger and your own timeout in the server for the connected clients.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive