Merge branch 'master' into ubuntu-18.04

This commit is contained in:
Robert J. Hansen
2020-07-01 01:33:23 -04:00

View File

@@ -307,8 +307,16 @@ int main(int argc, char* argv[]) {
if (dry_run) return EXIT_SUCCESS;
boost::asio::io_service io_service;
tcp::endpoint endpoint(tcp::v4(), port);
tcp::acceptor acceptor(io_service, endpoint);
const char* listen_address = "::";
boost::asio::ip::address address = boost::asio::ip::address::from_string(listen_address);
tcp::endpoint endpoint(address, port);
tcp::acceptor acceptor(io_service, endpoint.protocol());
if (endpoint.protocol() == tcp::v6()) {
boost::system::error_code ec;
acceptor.set_option(boost::asio::ip::v6_only(false), ec);
}
acceptor.bind(endpoint);
acceptor.listen();
while (true) {
tcp::iostream stream;