I need to be able to send on 1 port, and receive on a different port (to avoid collisions), How can I do that? I tried searching for an example and came up empty.
Send is on one, Receive is on the other. Not sure how to handle the UDP Packet Received event for the connection I want. ?Because if data comes through on the send-only connection, I need to reject it.
Each socket has an event name, that you set when you initialize it.
B4X:
Sub Process_Globals
Dim socketSend, socketReceive as UDPSocket
End Sub
Sub Activity_Create ...
'...
socketSend.initialize("socketSend",...) 'First parameter is the event name!
socketReceive.initialize("socketReceive",....)
'...
End Sub
Sub socketReceive_PacketArrived (Packet As UDPPacket)
'...this is he one that you are listening to
End Sub