The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
SDL2 C++ how get to LAN IPaddress 192.
goxl


Joined: 23 Jan 2014
Posts: 17
hi,everyone

SDLNet_ResolveHost(&ip,"localhost",0) has address is "127.0.0.1"

how can i do get "192.168.*.*"

thanks!!!
goxl


Joined: 23 Jan 2014
Posts: 17
i use c++ on android
not use java
SDL2 C+ + how get to LAN IPaddress 192.168.*.* on ANDROI
MrOzBarry


Joined: 26 Jun 2010
Posts: 620
I believe you can do a SDLNet_ResolveHost( &ip, "your computers hostname" ); to get a LAN ip address.

http://www.beej.us/guide/bgnet/output/html/multipage/syscalls.html#gethostname



When in doubt, consult http://www.beej.us/guide/bgnet/
Literally the best network programming guide in existence, and also an entertaining read.





On Fri, Aug 15, 2014 at 9:58 PM, goxl wrote:
Quote:
hi,everyone

SDLNet_ResolveHost(&ip,"localhost",0) has address is "127.0.0.1"

how can i do get "192.168.*.*"

thanks!!!


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

SDL2 C++ how get to LAN IPaddress 192.
MrOzBarry


Joined: 26 Jun 2010
Posts: 620
Also, if English isn't your first language, it's been translated to a few different languages, too: http://www.beej.us/guide/bgnet/


On Fri, Aug 15, 2014 at 9:59 PM, goxl wrote:
Quote:
i use c++ on android
not use java


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Re: SDL2 C+ + how get to LAN IPaddress 192.168.*.* on AN
goxl


Joined: 23 Jan 2014
Posts: 17
MrOzBarry wrote:
I believe you can do a SDLNet_ResolveHost( &ip, "your computers hostname" ); to get a LAN ip address.

http://www.beej.us/guide/bgnet/output/html/multipage/syscalls.html#gethostname



When in doubt, consult http://www.beej.us/guide/bgnet/
Literally the best network programming guide in existence, and also an entertaining read.





On Fri, Aug 15, 2014 at 9:58 PM, goxl wrote:
Quote:
hi,everyone

SDLNet_ResolveHost(&ip,"localhost",0) has address is "127.0.0.1"

how can i do get "192.168.*.*"

thanks!!!


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org





thanks
but this use platform API,how can i do get it only use SDL2 API