iOS Question Job Timeout ?

tufanv

Expert
Licensed User
Longtime User
Hello,

I have started to use 2 servers for my finance app , one is the cps and other one is my home server for testing purposes. What I am trying to achieve is first try my home server if homeserver is not online continue with the vps . I use this code under jobdone's if job.success=false :

B4X:
If aktifserver=homeserver Then
                aktifserver=roseserver
            Else
                aktifserver=homeserver
            End If

aktifserver is a string for the url which httpjob uses with :

B4X:
                Dim connection As HttpJob
                connection.Initialize("getir",Me)
            connection.PostString(aktifserver,"action=getir&paket="&GetAppName)

so if the job fails active server changes to other one for further tries . Homeserver is set to be tried first with app launch.

My problem is , when i disconnect my homeserver from the internet and launch my app , my app first tries my home server but before it gets the job fail : JobName = getir, Success = false

it takes too much time like 20-30 seconds so that it continues to other one . I need about 3-4 second at most to switch the servers . How can i achieve this ?

TY
 
Top