'Non-UI application (console application)
#Region Project Attributes
#CommandLineArgs:
#MergeLibraries: False
#End Region
Sub Process_Globals
'Private domain As String = "xxx"
'Private token As String = "yyy"
Private updateIp As Timer
Private srvr As Server
Public filesFolder As String = "uploaded"
Dim lMsgOk As List
End Sub
Sub AppStart (Args() As String)
updateIp.Initialize("updateIp", 10 * 60 * 1000) '10 minutes
updateIp.Enabled = True
'UpdateIp_Tick
srvr.Initialize("srvr")
srvr.Port = 54021
File.MakeDir(File.DirApp, filesFolder)
srvr.AddHandler("/upload", "Upload", False)
srvr.AddHandler("/test", "Test", False)
srvr.Start
Log("Server started")
lMsgOk.Initialize
lMsgOk.Add("Test")
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