c#: IPAddress.IsLoopback() treating 255.255.255.255 as Loopback IP

  • Thread starter Thread starter Sanjay234
  • Start date Start date
S

Sanjay234

Guest
Hi Team,
Need some help. i am new to network coding. I am using the below code:

if (IPAddress.IsLoopback(statusMessage.IPAddress))
{
TraceLogger.Debug("DBG:: Loopback IP so returning...");
return;
}

The Code build using visual studio 2017, treating the IP Address 255.255.255.255 as not a Loopback address.
The Code build using visual studio 2012, treating the IP Address 255.255.255.255 as Loopback address.

Any suggestions to resolve this.

As per the article(IPAddress.IsLoopback(IPAddress) Method (System.Net)), loopback ip address range is 127.0.0.0 – 127.255.255.255.

Then why 255.255.255.255 is treating as Loopback address.

Regards,
Sanjay.

Continue reading...
 
Back
Top