Boost logo

Boost Users :

Subject: Re: [Boost-users] how to know my own IP address
From: Tommy Nordgren (tommy.nordgren_at_[hidden])
Date: 2009-08-14 10:23:27


On Aug 14, 2009, at 2:49 PM, Paolo Viotti wrote:

> Hi,
>
> I'm using the boost library to create and manage a UDP socket.
> I was wondering if there is a way to know the public address of my
> machine using the boost classes.
> With this code
>
> udp::endpoint thisendpoint(udp::v4(), UDPPORT);
> boost::asio::ip::address myaddress = thisendpoint.address();
> std::cout<< "__My IP address: " << myaddress.to_string() << std::endl;
>
> I can only print the any_address (0.0.0.0)...
> thanks,
>
> p_viotti
> _______________________________________________

        You can always adress your own machine via the special ip adress
127.0.0.1
(or the special domain localhost)
------
What is a woman that you forsake her, and the hearth fire and the home
acre,
to go with the old grey Widow Maker. --Kipling, harp song of the Dane
women
Tommy Nordgren
tommy.nordgren_at_[hidden]


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net