iOS Question HTTPUtils2 only working when stepping in debug?

MotoMusher

Active Member
Licensed User
Longtime User
I have no idea why this is happening.

I am using v2.1 of httpjob and httputils2service.

I call
B4X:
    Dim j As HttpJob
    If j.IsInitialized = False Then
        j.Initialize("SecReq", Me)
    End If

    j.PutFile("http://centers.bubblergps.com/api/user", Main.MyFilePath, "tempsec.json")

If I put a breakpoint there and step through line by line it works every time, and comes back to my jobdone event.

If I do not have a breakpoint, if fails ALMOST every time (when it doesn't the jobdone event isn't fired, but doesn't error). Error follows.
 

AHilton

Active Member
Licensed User
Longtime User
I'm having the same problem as MotoMusher except I'm doing a ServerJob.PostString() instead of his .PutFile()

I've traced it back to the HttpJob Modules' Complete Sub ...
B4X:
Public Sub Complete (res1 As HttpResponse)
    res = res1
    Log("HTTPJob Target: " & target)
    CallSub2(target, "JobDone", Me)
End Sub

When things work correctly, target holds an object reference. When it doesn't, target holds nothing. The HTTPJob.initialize gets the TargetModule object but, somehow, that gets lost between Initiliaze and the Complete subs.

If I set a debug break on: "res=res1" then everything works just fine. Otherwise, it fails more times than not.


B4i v2.30, IPhone 6 - iOS 9.2
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…