'Non-UI application (console / server application)
#Region Project Attributes
#CommandLineArgs:
#MergeLibraries: True
#End Region
Sub Process_Globals
Private zeitmaschine As Timer
Private halserver As ServerSocket
Private halstream As AsyncStreams
Private a As Int =0
End Sub
Sub AppStart (Args() As String)
zeitmaschine.Initialize("zeitmaschine",2300)
zeitmaschine.Enabled=True
halserver.Initialize(51042, "Halserver")
halserver.Listen
StartMessageLoop
End Sub
'Return true to allow the default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
Return True
End Sub
Sub zeitmaschine_tick
a=a+1
Log(a)
If halserver.IsInitialized=True Then Log("is init")
'halstream.Write("received!".GetBytes("utf8"))
End Sub
Sub halserver_NewConnection (Successful As Boolean, NewSocket As Socket)
Log("New connection")
If Successful Then
halstream.Initialize(NewSocket.InputStream, NewSocket.OutputStream, "halstream")
End If
halserver.Listen
Log ("Hal is listening")
End Sub