Android Question B4A: Read timed out

grafsoft

Well-Known Member
Licensed User
Longtime User
During a download of approx 1 MB, I get a java message that says : java.net.SocketTimeoutException: Read timed out

B4X:
     s=Main.hostname & "uploads/" & fname
     DoEvents
     Dim jobdnld As HttpJob
     jobdnld.Initialize ("dnld",Me)
     jobdnld.Download (s)


Sub JobDone (job As HttpJob)
   Dim t As String
   If job.Success = True Then
  Select job.JobName
       Case "dnld":
             ...
     End Select
   Else
     Msgbox (job.ErrorMessage,fname)
     ' here I see the error message

   End If
end sub

How can I set the timeout?
 

DonManfred

Expert
Licensed User
Longtime User
How can I set the timeout?
Have you tried to use the forumsearch? There ae hundrets of examples you will find as this ia asked a lot of times...

B4X:
Job.Download(...)
Job.GetRequest.Timeout = 60000
 
Upvote 0

grafsoft

Well-Known Member
Licensed User
Longtime User
I did search, but not find :(

This does not compile. Timeout is unknown. I use the OKHTTP library.

B4X:
     Dim jobdnld As HttpJob
     jobdnld.Initialize ("dnld",Me)

     Log (jobdnld.GetRequest.timeout)
     
     jobdnld.Download (s)
     jobdnld.timeout=60000
 
Upvote 0

grafsoft

Well-Known Member
Licensed User
Longtime User
The compiler stopped here: Log (jobdnld.GetRequest.timeout)
But not any more, thanks to you.
 
Upvote 0
Top