$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-users] how to know my own IP address
From: Paolo Viotti (skypixel_at_[hidden])
Date: 2009-08-14 08:49:02
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