Use IPAddress.Parse .
public static void Receive(ref IPEndPoint remoteEndPoint) {
IPAddress target = IPAddress.Parse ("127.0.0.1" );
if (!remoteEndPoin t.Address.Equal s(target)) {
return;
}
// rest of method here
}
Of course you should cache the target endpoint and not parse it every
time, but the above explains what's needed.
HTH,
Sam
------------------------------------------------------------
We're hiring! B-Line Medical is seeking Mid/Sr. .NET
Developers for exciting positions in medical product
development in MD/DC. Work with a variety of technologies
in a relaxed team environment. See ads on Dice.com.
"Ryan Liu" <ad********@onl ine.sh.cnwrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
Hi,
Can someone tell me how to calculate an IPaddress's long value?
I have an application which lisiten on a port using UDP protocol. There
could be multiple client sendind UDP data to it and I am only interested
data from one client, I know that client's IP address in form of 127.0.0.1
etc.
I think I need convert that IP into IPaddress then can compare with
parameter in
UdpServer.Recei ve(ref remoteIpEndPoin t);
Thanks a lot in advance!
Ryan