Sub PollForCommands
Dim Job1 As HttpJob
Job1.Initialize("JobCommand",Me)
Job1.PostString(Main.HTTPServer & "command.aspx","Postcode=" & Main.ActivePostcode & "&UserEmail=" & Main.ActiveUserEmail)
Job1.GetRequest.Timeout = 120000
End Sub
Sub JobDone (Job As HttpJob)
Select Job.JobName
Case "JobCommand"
If Job.Success Then
'Check if Timed Out
Dim TimedOut As Boolean
TimedOut = False
If Job.GetString.Length >= 8 Then
If Subs.Left(Job.GetString,8) = "TimedOut" Then
TimedOut = True
End If
End If
If TimedOut Then
CallSub2(PhoneMonitor,"ShowCommands","TimedOut Server...")
Else
CallSub2(PhoneMonitor,"ShowCommands",Job.GetString)
If AutoSendCommands Then CallSub(PhoneMonitor,"btn_RunCommand_Click")
End If
Else
CallSub2(PhoneMonitor,"ShowCommands","TimedOut HTTP...")
End If
PollForCommands
Case Else
ToastMessageShow("Command Engine: Unknown HTTPJob: " & Job.JobName, False)
End Select
Job.Release
End Sub