|
|
@ -47,12 +47,10 @@ void JabberConnector::connectToServer ( const TQString &server )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
kdDebug ( JABBER_DEBUG_GLOBAL ) << k_funcinfo << "Initiating connection to " << server << endl;
|
|
|
|
kdDebug ( JABBER_DEBUG_GLOBAL ) << k_funcinfo << "Initiating connection to " << server << endl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mServer = server;
|
|
|
|
mErrorCode = KNetwork::TDESocketBase::NoError;
|
|
|
|
mErrorCode = KNetwork::TDESocketBase::NoError;
|
|
|
|
|
|
|
|
|
|
|
|
if( mHost.isEmpty() ) {
|
|
|
|
if( mHost.isEmpty() ) {
|
|
|
|
if( mSrvResolver->isBusy() ) {
|
|
|
|
|
|
|
|
mSrvResolver->stop();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
mSrvResolver->resolve(server, "xmpp-client", "tcp");
|
|
|
|
mSrvResolver->resolve(server, "xmpp-client", "tcp");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -90,14 +88,21 @@ void JabberConnector::slotError ( int code )
|
|
|
|
void JabberConnector::slotSrvLookup()
|
|
|
|
void JabberConnector::slotSrvLookup()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if( mSrvResolver->failed() ) {
|
|
|
|
if( mSrvResolver->failed() ) {
|
|
|
|
mErrorCode = KNetwork::TDESocketBase::LookupFailure;
|
|
|
|
if( mErrorCode == KNetwork::TDESocketBase::NoError ) {
|
|
|
|
emit error ();
|
|
|
|
// SRV records probably not exist - try server and default port as fallback
|
|
|
|
|
|
|
|
if ( !mByteStream->connect ( mServer, TQString::number ( 5222 ) )) {
|
|
|
|
|
|
|
|
mErrorCode = mByteStream->socket()->error ();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if( mErrorCode != KNetwork::TDESocketBase::NoError ) {
|
|
|
|
|
|
|
|
emit error ();
|
|
|
|
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if( !mByteStream->connect( mSrvResolver->resultAddress().toString(), TQString::number( mSrvResolver->resultPort() ))) {
|
|
|
|
if( !mByteStream->connect( mSrvResolver->resultAddress().toString(), TQString::number( mSrvResolver->resultPort() ))) {
|
|
|
|
mErrorCode = mByteStream->socket()->error ();
|
|
|
|
mErrorCode = mByteStream->socket()->error ();
|
|
|
|
emit error ();
|
|
|
|
mSrvResolver->next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|