Android Question Remote Database Connect - Timeout

mrumball

Member
Licensed User
Longtime User
I am using the RDC to connect to sql server, some of the batch commands are taking quite a long time and causing

'Error: java.net.SocketTimeoutException'



Is there any way i can extend the time out ?

Thanks
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Yes. Add a reference to Http library and change ExecuteBatch to:
B4X:
Public Sub ExecuteBatch(ListOfCommands As List, Tag As Object)
   Dim j As HttpJob
   Dim ms As OutputStream
   Dim out2 As OutputStream = StartJob(j,ms, Tag)
   WriteInt(ListOfCommands.Size, out2)
   For Each Command As DBCommand In ListOfCommands
     WriteObject(Command.Name, out2)
     WriteList(Command.Parameters, out2)
   Next
   out2.Close
   j.PostBytes(link & "?method=batch", ms.ToBytesArray)
   j.GetRequest.Timeout = 180000 '<------
End Sub
 
Upvote 0
Top