SFML community forums
Help => Network => Topic started by: Grimshaw on September 03, 2011, 12:11:02 am
-
When i do this:
sf::IpAddress::GetLocalAddress().ToString();
I get 127.0.0.1, i was expecting my LAN address 192.168.10.2.
Any other way to get it?
Thanks
-
When i do this:
sf::IpAddress::GetLocalAddress().ToString();
I get 127.0.0.1, i was expecting my LAN address 192.168.10.2.
Any other way to get it?
Thanks
Thats weird, you should think IpAdress::LocalHost would be 127.0.0.1.. SFML Network doesn't seem to be able to list assigned ipadresses either, maybe we should post this feat on the bugtracker :p
for now i found this: http://www.codeguru.com/forum/showthread.php?t=233261
-
Handling multiple network interfaces in SFML is planned for the future.
I don't know why you get localhost instead of your local network address, but maybe it's related to this issue:
https://github.com/SFML/SFML/issues/47
What's your OS?
-
Windows 7 32bit !
I have a really simple ISP service through ADSL. I own a DLink wireless router, to which the laptops in my house connect. My computer connects directly via RJ-45 cable.
My computer and the laptops work fine as a LAN, even allowing file sharing etc.
Thanks
-
Hm, I tried this out and found out I also get 127.0.0.1 ! :S
std::cout << "Local address: " << sf::IpAddress::GetLocalAddress().ToString().c_str() << "\n";
std::cout << "Public address: " << sf::IpAddress::GetPublicAddress().ToString().c_str() << "\n";
Gives;
Local address: 127.0.0.1
Public address: 81.170.129.***
OS: Windows XPSP3 w/ latest updates
SFML: old unstable of 2.0
Network: RJ45 -> Router(D-Link DIR 615) -> Fibreconverter
Local addresses;
192.168.0.100 - Network
192.168.56.1 - Virtualbox Hostonly
Doesnt matter if i disable virtualbox adapter
-
I can reproduce the bug too. It seems that is was broken with some revision a few months ago; so at least I should be able to fix it easily :)
Thanks for your feedback.
-
When its fixed please warn us Laurent, and thanks a lot for all the support. You re the man :)
-
It's fixed.