[Qt-interest] Discover IP address and Turn Into QUrl

Bryce Salmi Bryce.Salmi at zoran.com
Tue Sep 22 21:56:44 CEST 2009


Colin,
    Yes I am accessing a webserver running on the same machine. However,
I did not design the server and localhost is currently disabled. Thank
you for the suggestion.




Bryce

-----Original Message-----
From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of Colin S. Miller
Sent: Tuesday, September 22, 2009 3:47 PM
Cc: qt-interest at trolltech.com
Subject: Re: [Qt-interest] Discover IP address and Turn Into QUrl

Bryce Salmi wrote:
> Qt Interest,
> 
>      I have been trying to get my IP address (on embedded Qt with ARM)

> rather than set it statically.  So far I have successfully been able
to 
> get the IP and turn it into a char* where I can printf( "%s",ip); and 
> have it return the IP address as a dotted decimal (192.168.1.20). 
> However, I am trying to use the IP in an HTTP query to invoke a cgi 
> script.  This works perfectly when I set the IP address statically.
Here 
> is an example assuming ip is a (char *) with the IP already set:
> 
>  
> 
Bryce,
Are you trying to access a webserver running on the same machine as
your Qt program?

If so, then
http://127.0.0.1/somedir/somescript.cgi
should work;
127.0.0.1 is always the local address.

HTH,
Colin S. Miller

_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest




More information about the Qt-interest-old mailing list