Sub Process_globals
Dim socket1 as socket
Dim AStream As AsyncStreams
Dim IPAddress as string
End sub
Sub Activity_Create(FirstTime As Boolean)
Socket1.Initialize("Socket1")
End Sub
Sub Doit
IPAddress = "192.168.2.4"
Try
ProgressDialogShow("Loading Profile ")
Socket1.Connect(IPAddress,5500,20000)
Catch
Log("WIProfileLoader failed " & LastException.Message)
End Try
End Sub
Sub Socket1_Connected (Success As Boolean)
Log("WIProfileLoader connected: " & Success)
If Success = False Then
Msgbox("Server is busy, off or out of range. Try again later.","")
Socket1.close
AStream.Close
Activity.Finish
StartActivity("Display")
Else
If AStream.IsInitialized = False Then
AStream.InitializePrefix(Socket1.InputStream, True, Socket1.OutputStream, "AStream")
End If
End If
End Sub