Android Question Jrcd2 Library - Cliente side. How do I know if ther server is down?

Q Candiani

Member
Licensed User
Longtime User
Hello everybody,

I'm using a jrdc2 library. On the client side, I want to know if the server is down or not, before starting to work with it, to raise an alternative off-line workspace if it's necessary.

This subroutine does not return any message or error when the server is down.

B4X:
Sub CreateRequest As DBRequestManager
   Dim req As DBRequestManager
   req.Initialize(Me, rdcLink)
   Return req
End Sub

Thanks
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
The relevant sub is:
B4X:
Sub GetRecord (id As Int)
   Dim req As DBRequestManager = CreateRequest
   Dim cmd As DBCommand = CreateCommand("select_animal", Array(id))
   Wait For (req.ExecuteQuery(cmd, 0, Null)) JobDone(j As HttpJob)
   If j.Success Then
       req.HandleJobAsync(j, "req")
       Wait For (req) req_Result(res As DBResult)
       'work with result
       req.PrintTable(res)
   Else
       Log("ERROR: " & j.ErrorMessage) '<---------------------------------------------
   End If
   j.Release
End Sub
 
Upvote 0
Top