[Asio] Common method of converting boost::asio::ip::address to network for both v4() and v6() addresses ?
27 May
2011
27 May
'11
7:53 p.m.
Greetings, 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 end. For example: 127.0.1.1 = 2130706689 Clearly, this won't work for an ipv6 address, as requires more bytes. The address 127.0.1.1 represents as: v6(): endpoint.address().to_string() yields ::ffff:127.0.1.1 v4(): endpoint.address().to_string() yields 127.0.1.1 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, Sean
4916
Age (days ago)
4916
Last active (days ago)
0 comments
1 participants
participants (1)
-
Sean Ryan