Boost logo

Boost Users :

Subject: [Boost-users] [Asio] Common method of converting boost::asio::ip::address to network for both v4() and v6() addresses ?
From: Sean Ryan (sryan_at_[hidden])
Date: 2011-05-27 15:53:43


 As a short background, I have a protocol which transfers IPs by
 converting to a uint32_t and then shifting out the bytes on the other

 For example: = 2130706689

 Clearly, this won't work for an ipv6 address, as requires more bytes.

 The address represents as:

 endpoint.address().to_string() yields

 endpoint.address().to_string() yields

 Is there a method within the boost implementation that would allow ( or
 assist ) an effort to a uniform interpretation of the
 boost::asio::ip::address ( I expect this will likely involve the
 utin64_t over the 32 ... which I can live with ) ?

 Many thanks,

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at