Log.debug("Trying to create socket connection to XMPP domain '{}' using remote host: {}:{} (blocks up to {} ms) ...",xmppDomain,realHostname,realPort,socketTimeout);
Log.debug("Successfully created socket connection to XMPP domain '{}' using remote host: {}:{}!",xmppDomain,realHostname,realPort);
returnsocket;
}
catch(Exceptione)
{
Log.debug("An exception occurred while trying to create a socket connection to XMPP domain '{}' using remote host {}:{}",xmppDomain,realHostname,realPort,e);
Log.warn("Unable to create a socket connection to XMPP domain '{}' using remote host: {}:{}. Cause: {} (a full stacktrace is logged on debug level)",xmppDomain,realHostname,realPort,e.getMessage());
try
{
if(socket!=null)
{
socket.close();
socket=null;
}
}
catch(IOExceptionex)
{
Log.debug("An additional exception occurred while trying to close a socket when creating a connection to {}:{} failed.",realHostname,realPort,ex);
}
}
}
Log.warn("Unable to create a socket connection to XMPP domain '{}': Unable to connect to any of its remote hosts.",xmppDomain);