Details
-
Improvement
-
Status: Resolved
-
Low
-
Resolution: Fixed
-
None
-
None
-
Mac OS X and Linux with machines that have multiple network interfaces whereby the IP associated with the split is not on the network interface associated with localhost.
Description
On unix machines that have multiple network interfaces whereby the IP associated with the split is not on the network interface associated with localhost, the getLocation method cannot find the proper IP and throws an exception "no connection available".
I changed the implementation to use NetworkInterface instead of InetAddress using getLocalHost().
This is more reliable. See the following references:
http://stackoverflow.com/questions/5813194/inetaddress-getlocalhost-does-not-return-expected-ip-address-from-c-windows-sy
http://stackoverflow.com/questions/4871451/inetaddress-getlocalhost-returns-wrong-result-when-hostname-is-64-chars
http://www.jguru.com/faq/view.jsp?EID=790132