Click here to Skip to main content
15,880,891 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
there are 5 gates

gates have ip adresses and same port number and data

each gates send data but ı want to learn which gate send me data(what is the ipadress of sendergate)


which one send me data what is this gate ip adress?
Posted
Updated 31-Jan-12 22:35pm
v2
Comments
Member-2338430 1-Feb-12 4:32am    
very important for me how to learn sendergate ip adress?
Sergey Alexandrovich Kryukov 1-Feb-12 4:34am    
Why? why? I think this is a violation of the paradigm. The server end does not know client IP, clients are identified by data. No chance to identify by data? (And change data for this purpose.)
--SA
Sergey Alexandrovich Kryukov 1-Feb-12 4:33am    
Is it a part of functionality or for debugging purposes?
--SA
Member-2338430 1-Feb-12 4:58am    
all of them

we can change each gates port number so which one send data we can catch it but we want to use same port and we learn which gate send data and its ip adress we want towork with ip adress not port number
Member-2338430 1-Feb-12 5:00am    
IPEndPoint From = new IPEndPoint(IPAddress.Any, HostPort);

ı want to learn IPAddress.Any not any which one we change this part

1 solution

Hi,

If you use the UdpClient instead of the Socket you can use the Async EndReceive(ar, ref endPoint). After completion the endPoint will contain the address from where the data came (as I believe the question was)

Hope this helps.

Cheers, AT
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900