socket.beginrecieve method for UDP. find out who sent you the data?
C#
2
Posts
2
Posters
0
Views
1
Watching
-
Is there anyway when using the beginrecieve method for a socket bounded to listen on a udp port to find out who is sending the data (remote ip address)?
Use
BeginReceiveFrom
specify theremoteEP
parameter asnew IPEndPoint(IPAddress.Any, 0)
. This will allow you to receive from any sending peer (or you can limit it here to receive only from specific address or port). Then useEndReceiveFrom
to find who's sent the packet. (details in documentation)