this is the part of QAbstractSocket.cpp Qt-4.4.2 code: This function is called after connectToHost(...) void QAbstractSocketPrivate::_q_startConnecting(const QHostInfo &hostInfo) { ... addresses = hostInfo.addresses(); ... // Try all addresses twice. WHAT FOR? addresses += addresses; if (addresses.isEmpty()) { HERE THE ERROR SIGNAL MUST BE EMITTED, BUT... ... state = QAbstractSocket::UnconnectedState; socketError = QAbstractSocket::HostNotFoundError; q->setErrorString(QLatin1String(QT_TRANSLATE_NOOP("QAbstractSocket", "Host not found"))); emit q->stateChanged(state); emit q->error(QAbstractSocket::HostNotFoundError); return; } ... // Report the successful host lookup WHY HERE & WHERE IS THE SUCCESS? O_o emit q->hostFound(); ... >>> _q_connectToNextAddress(); } void QAbstractSocketPrivate::_q_connectToNextAddress() { ... // Start the connect timer. if (threadData->eventDispatcher) { if (!connectTimer) { connectTimer = new QTimer(q); QObject::connect(connectTimer, SIGNAL(timeout()), q, SLOT(_q_abortConnectionAttempt()), Qt::DirectConnection); } >>> connectTimer->start(QT_CONNECT_TIMEOUT); } ... } void QAbstractSocketPrivate::_q_abortConnectionAttempt() { ... if (socketEngine) { socketEngine->setWriteNotificationEnabled(false); if (socketEngine->isValid()) >>> _q_testConnection(); } } void QAbstractSocketPrivate::_q_testConnection() { if (socketEngine) { if (socketEngine->state() != QAbstractSocket::ConnectedState) { // Try connecting if we're not already connected. if (!socketEngine->connectToHost(host, port)) { if (socketEngine->error() == QAbstractSocket::UnfinishedSocketOperationError) { // Connection in progress; wait for the next notification. socketEngine->setWriteNotificationEnabled(true); >>> return; SEE U IN _q_abortConnectionAttempt() & SO ON } } } if (threadData->eventDispatcher) { if (connectTimer) connectTimer->stop(); } } } Qt-4.2.2 code: void QAbstractSocketPrivate::_q_testConnection() { if (threadData->eventDispatcher) { if (connectTimer) connectTimer->stop(); } if (socketEngine && (socketEngine->state() == QAbstractSocket::ConnectedState || socketEngine->connectToHost(host, port))) { fetchConnectionParameters(); return; } #if defined(QABSTRACTSOCKET_DEBUG) qDebug("QAbstractSocketPrivate::_q_testConnection() connection failed," " checking for alternative addresses"); #endif _q_connectToNextAddress(); }