Boost logo

Boost :

From: Gavin Lambert (boost_at_[hidden])
Date: 2023-05-16 05:01:51


On 16/05/2023 15:26, Tarun Batra wrote:
> I have a code something like this:
>
> TcpConnection::pointer my_conn = GetConn(req);
>
> tcp::socket& my_socket = my_conn->getSocket();
>
> tcp::resolver my_resolver(my_socket.get_executor());
>
>
> Is it possible to check if the my_socket is ipv4 socket or ipv6 socket?

That depends exactly what you mean by that, but you're likely looking
for something like:

     my_socket.remote_endpoint().address().is_v6()

Doxygen doesn't do a very good job at navigating the type templates
involved here; using your IDE's code completion is more successful.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk