I'm trying to send to the loopback address space in a .NET 3.5 application running on Windows XP. The code does a simple:
receiver = new IPEndPoint(IPAddress.Parse("127.0.0.2"), 8000);
sock.SendTo(data, len, SocketFlags.None, receiver);
When I run the code I get an unreachable host socket exception. That seems strange to me because the loopback interface is always around, and it shouldn't generate any unreachable host exceptions.
Windows 7 executes the code just fine, making the problem that much stranger.
So -- if anyone has any tips on getting this working in XP, I'd appreciate it.
EDIT:
Some info:
- Something is listening on 127.0.0.2, my netstat shows:
UDP 127.0.0.2:8000 : 5824
I am running XP SP3, and there is no firewall on my test machine
I'm noticing on XP when I ping 127.0.0.2, the replies come back:
Reply from 127.0.0.1
On Windows 7 the reply comes back from the address I pinged:
Reply from 127.0.0.2
I'm thinking this could be the issue and as such it's not really a programming problem, it's more of a problem with XP itself...
-- Dan