Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Dim UDPSocket1 As UDPSocket
Dim jip As ServerSocket 'ignore
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.SetFormStyle("UNIFIED")
'MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
'MainForm.Show
UDPSocket1.Initialize("UDP", 8888, 8000)
Log("Local IP:" & jip.GetMyIP)
End Sub
Sub UDP_PacketArrived (Packet As UDPPacket)
Log ("Request from:" & Packet.HostAddress)
If Packet.HostAddress <> jip.GetMyIP Then
Log("Send response: " & Packet.HostAddress)
Dim Packet As UDPPacket
Dim dest As String
Dim data() As Byte
data = "CONTROLLER".GetBytes("UTF8")
dest = "255.255.255.255"
Packet.Initialize(data, dest, 8888)
UDPSocket1.Send(Packet) '<-- this line do nothing...
End If
End Sub