I'm writing code to connect with a Global Cache Itach. This device broadcasts a UDP packet on port 4998 once a minute. I know it is working because I wrote a windows app which picks up the UDP packet no problem.
Also, I can connect to the device through the browser on its TCP/IP port.
Anyway, here is the code I used to test it. This runs(on the Android tablet through B4A-Bridge) but UDP_PacketArrived never gets called.
'Activity module
Sub Process_Globals
Dim UDPSocket1 As UDPSocketEnd Sub
Sub Globals
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
UDPSocket1.Initialize("UDP", 4998, 8000)
End If
End Sub
Sub UDP_PacketArrived (Packet As UDPPacket)
Dim msg As String
msg = BytesToString(Packet.Data, Packet.Offset, Packet.Length, "UTF8")
Msgbox("Message received: " & msg, "")
End Sub
Does anyone have an idea why this doesn't work? By the way, I am able to send UDP packets with B4A no problem.
Thanks to all you dedicated helpers online!
Also, I can connect to the device through the browser on its TCP/IP port.
Anyway, here is the code I used to test it. This runs(on the Android tablet through B4A-Bridge) but UDP_PacketArrived never gets called.
'Activity module
Sub Process_Globals
Dim UDPSocket1 As UDPSocketEnd Sub
Sub Globals
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
UDPSocket1.Initialize("UDP", 4998, 8000)
End If
End Sub
Sub UDP_PacketArrived (Packet As UDPPacket)
Dim msg As String
msg = BytesToString(Packet.Data, Packet.Offset, Packet.Length, "UTF8")
Msgbox("Message received: " & msg, "")
End Sub
Does anyone have an idea why this doesn't work? By the way, I am able to send UDP packets with B4A no problem.
Thanks to all you dedicated helpers online!