Hi Everybody,
If in JOBDONE sub I put the next code:
B4X:
If job.Success=False Then
job.Release
End If
in case of success=False I get an error "File missing".
I have seen that the "Release" sub deletes a temporary file.
In the examples the release is issued in any case, both successful or not.
In my opinion if no answer comes from the server the temp file is never created.
Am I wrong?
I have probably found the issue: I was connecting www.google.it
B4X:
Dim sito As String= "http://www.google.it"
If httpx.IsInitialized=False Then httpx.Initialize("httpx",Me)
httpx.Download(sito)
Crashes on Job.GetString with no file....
Although job.success is true.
In my opinion the download of the page is not finished when jobdone event is issued.
Looks like you are dimming it just ONCE and not for each download..
try
B4X:
Dim sito As String= "http://www.google.it"
dim httpx as httpjob ' Use a DIM for EACH Job you want to execute
httpx.Initialize("httpx",Me)
httpx.Download(sito)
I get the error in GetString()(the file containing data from internet server is missing). What's the need for isInitialized call if you need to initialize every time, gothic question....?
Thank you Don(the kindest IT man around!).
I took away the code, since it was only a test to see if Internet was up.
Best regards and have an happy week end!
The need is not the second (3rd, 4th...) initialisation.
The need is the creating of a new instance (DIM) of httpjob (this includes the initialisation though)