Open drewcoaustralia opened 8 years ago
Technically its not wrong by returning an IP address of 127.0.0.1, that's almost always the IP address of your loopback interface.
The biggest challenge with properly implementing this is trying to select the correct IP address. Most OS's will have more than 1 interface connected at a time, your main internet connection and your loopback interface. It should be fairly easy to filter out loopback interfaces...but what happens when you have more connected interfaces than 2?
If you've got VMware or VirtualBox installed, you'll have interfaces for those. If you've got both a wireless and wired connection, you'll need to determine which one you prefer. If you've got hamachi, that'll have its own interface. Many VPN programs also install their own virtual interfaces.
Perhaps the best way to proceed is to return a list of interfaces with their IP addresses?
I'm messing around with networking stuff and for some reason every time I call MyIP() it returns 127.0.0.1 which is obviously wrong. I've had to manually check IPs which is annoying and impractical, so it'd be appreciated if this could be fixed. On the windows build of the pascal version btw (latest version)
EDIT: Just looked at Source Code and realised it returns that as a constant string. Any plans in the works on calculating the actual IP on the network?