Hello,
I am connecting to a TCP device using AsyncStreams and I have a sub called 'Streams_Terminated'.
I can connect to my device fine and send messages to it and get reply's fine, but my issue is that if my TCP device disconnects and looses connection to my app how can I make my app know that the connection has been lost?
I have used the code below but the sub 'AStreams_socket_Terminated' never gets called when my TCP device disconnects.
Is there another way to check if my device has lost connection my app?
I am connecting to a TCP device using AsyncStreams and I have a sub called 'Streams_Terminated'.
I can connect to my device fine and send messages to it and get reply's fine, but my issue is that if my TCP device disconnects and looses connection to my app how can I make my app know that the connection has been lost?
I have used the code below but the sub 'AStreams_socket_Terminated' never gets called when my TCP device disconnects.
B4X:
Sub Process_Globals
Dim AStreams_socket As AsyncStreams
End Sub
Sub AStreams_socket_Error
Log(LastException.Message)
End Sub
Sub AStreams_socket_Terminated
Log("terminated")
End Sub
Is there another way to check if my device has lost connection my app?