i try to start a UDP-Server in listening-mode,
but the port is not open.
B4X:
Sub Process_Globals
Dim UDPSocket2 As ServerSocket
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("main")
If FirstTime Then
UDPSocket2.Initialize(33333, "UDP")
End If
End Sub
Sub Activity_Resume
UDPSocket2.Listen
End Sub
Sub UDP_PacketArrived (Packet As UDPPacket)
If Packet.Port = 33333 Then Log("33333")
End Sub
What did i wrong?
Thanks for yor help.
Greetings from germany
Pf@nne
OK, but in Wireshark i see that port 33333 ist not reachable.
If i send UDP to port 33333 nothing happends.
This schould be show all recheived Data on ervery Port, isent it?
B4X:
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
Is my code in post #1, to open a UDP-Server in listenig mode on port 33333 OK?
Most mobile network providers block incoming connections (as well as many ports). I don't think that you will be able to use such a solution over mobile network.