Log("Trying to connect to: " & Host)
CloseExistingConnection
Dim client As Socket
client.Initialize("client")
client.Connect(Host, PORT, 10000)
Wait For Client_Connected (Successful As Boolean)
If Successful Then
astream.InitializePrefix(client.InputStream, False, client.OutputStream, "astream")
UpdateState (True)
Dim mm As MyMessage
mm.Initialize
mm.Command = "STARTKOMM"
mm.Timestamp = $"$DateTime{DateTime.Now}"$
mm.xml = ""
CallSub2(adatFriss, "NewData", ser.ConvertObjectToBytes(mm))
Else
Log("Failed to connect: " & LastException)
End If