JobClient: connect to IPv4 endpoints only

As long as the JobServer only listens on IPv4 endpoints, it makes no
sense to attempt a connect to an IPv6 endpoint on the client side.

(However, it's 2018 and we should also be capable of using IPv6 on
both the client and server side ...)

Change-Id: I9c3916466c350ce74a31cef3b6ae0e7ac56367c7
This commit is contained in:
Horst Schirmeier
2018-06-22 17:00:41 +02:00
parent c5e0825c6f
commit e63f7376f8

View File

@ -57,6 +57,10 @@ bool JobClient::connectToServer()
for (ip::tcp::resolver::iterator end,
addrs = resolver.resolve(query);
addrs != end; ++addrs) {
// server listens on IPv4 endpoint only, skip IPv6 endpoints
if (!addrs->endpoint().address().is_v4()) {
continue;
}
boost::system::error_code error;
m_d->socket.connect(addrs->endpoint(), error);
if (!error) {