Permalink
Browse files

Ignore network error on an interface that no longer exists.

Under some circumstances, a network interface can disappear during the lifetime of the process. Simply ignore those rather than failing the whole process (by default, networking operations must work on all interfaces found)
  • Loading branch information...
jyavenard committed May 10, 2013
1 parent 46c882c commit fd44e2fcbbc4c3dc6fe835c1d62686fafe3b2833
Showing with 16 additions and 0 deletions.
  1. +16 −0 mythtv/libs/libmythbase/serverpool.cpp
@@ -412,6 +412,14 @@ bool ServerPool::listen(QList<QHostAddress> addrs, quint16 port,
server->disconnect();
server->deleteLater();
if (server->serverError() == QAbstractSocket::HostNotFoundError)
{
LOG(VB_GENERAL, LOG_ERR,
QString("Address %1 no longer exists - ignoring")
.arg(PRETTYIP(it)));
continue;
}
if (requireall)
{
close();
@@ -498,6 +506,14 @@ bool ServerPool::bind(QList<QHostAddress> addrs, quint16 port,
.arg(socket->errorString()));
socket->disconnect();
socket->deleteLater();
if (socket->error() == QAbstractSocket::SocketAddressNotAvailableError)
{
LOG(VB_GENERAL, LOG_ERR,
QString("Address %1 no longer exists - ignoring")
.arg(PRETTYIP(it)));
continue;
}
if (requireall)
{

0 comments on commit fd44e2f

Please sign in to comment.