Boost logo

Boost :

From: Vinnie Falco (vinnie.falco_at_[hidden])
Date: 2019-09-23 14:13:38


On Sun, Sep 22, 2019 at 5:00 PM JH via Boost <boost_at_[hidden]> wrote:
> socket.bind(boost::asio::ip::tcp::endpoint(boost::asio::ip::tcp::v4(), 12345));

You are using the right function, but you are passing a
default-constructed IPv4 address. Why not just pass the local IP
address you want to bind to (instead of 0.0.0.0, which is what a
default-constructed address gives you). Look at the type of the
endpoint parameter in the call to bind:

<https://www.boost.org/doc/libs/1_71_0/doc/html/boost_asio/reference/basic_socket_acceptor/bind/overload2.html>

Regards


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