I know there is an Error event that will be called in case of a connection failure. But will this event *always* be called when anything is wrong with the connection ? Or should I provide something like a heartbeat mechanism ?
The Error or Terminated events will always be called when the device "knows" that the connection broke. The connection might appear to be connected although this is not the case.
For that reason I recommend you to use a heartbeat mechanism. You can check B4A-Bridge code for an example.
In order to implement a heartbeat mechanism I would like to have a timeout while reading from the stream. When a timeout occurs a TimeOut event should be called.
It seems this is not possible with the standard RadnomAccess library. Would it be possible to obtain the code so I can make my own version that implements this ?