Sub Process_Globals
Private domain As String = "http://test.duckdns.org"
Private token As String = "xxx"
Private updateIp As Timer
Public srvr As Server
Public rdcConnector1 As RDCConnector
Public const VERSION As Float = 2.22
Type DBCommand (Name As String, Parameters() As Object)
Type DBResult (Tag As Object, Columns As Map, Rows As List)
End Sub
Sub AppStart (Args() As String)
updateIp.Initialize("updateIp", 10 * 60 * 1000) '10 minutes
updateIp.Enabled = True
UpdateIp_Tick
srvr.Initialize("")
rdcConnector1.Initialize
srvr.Port = rdcConnector1.serverPort
srvr.AddHandler("/test", "TestHandler", False)
srvr.AddHandler("/rdc", "RDCHandler", False)
srvr.Start
Log($"jRDC is running (version = $1.2{VERSION})"$)
StartMessageLoop
End Sub
Sub UpdateIp_Tick
Dim j As HttpJob
j.Initialize("j", Me)
j.Download2("http://www.duckdns.org/update", Array As String("domains", domain, "token", token, _
"ip", ""))
End Sub
Sub JobDone (j As HttpJob)
If j.Success = True Then
Log("Update DuckDNS: " & j.GetString)
Else
Log("Error updating Duck DNS: " & j.ErrorMessage)
End If
j.Release
End Sub