Re: ./EuGTK/GtkEngine.e to Irv

new topic     » goto parent     » topic index » view thread      » older message » newer message
irv said...

OK, what is the correct way to get my ip address if I am connected to a network but NOT to the internet?

For example, I run my Eu webserver to make music available locally. I don't think anyone at whitehouse.gov wants to listen (to music, that is, they're already listening to everything else...).

Edit: a cross-platform solution would be nice.

One way is to get the hostname of the computer itself, then get the ip address for that hostname.

The 2nd step is easy to do - std/net/dns.e:host_by_name() will do the trick. However, we don't have the gethostname() function wrapped, even though it is portable: https://msdn.microsoft.com/en-us/library/windows/desktop/ms738527(v=vs.85).aspx and http://linux.die.net/man/2/gethostname

What's the purpose of getting the ip address though? Just checking for a live internet connectino is different from getting the ip to host a public webserver or something, which is different again from hosting a local fileserver that's not visible beyon the local lan, etc etc. Maybe I'm not understanding the scope here.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu