Boost-asio listens on multiple IP addresses on a single (TCP) acceptor

The TCP gain acceptor can be connected using an endpoint constructor that accepts only the port number as an argument, in which case it will listen on all IP addresses / network adapters.

Can I accept an acceptor to listen on selected IP addresses? Or do I need to create an acceptor for every IP address I'm interested in? Looking through the documentation, I could not find any signs that this was possible.

I have not watched the socket API for several years, but I think the API does not directly allow this.

+4
source share
1 answer

there is an unrelated hearing and associated with it. unbound means that you are listening to all network adapters that are tied to specific ones. I don’t think it’s possible to select some of the NICs, because the same can be achieved by special acceptors for each of them.

+6
source

All Articles