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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.