Changeset 769 for trunk/src/network/socket/qabstractsocket.cpp
- Timestamp:
- Aug 2, 2010, 9:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.3 (added) merged: 768 /branches/vendor/nokia/qt/current merged: 767 /branches/vendor/nokia/qt/4.6.2 removed
- Property svn:mergeinfo changed
-
trunk/src/network/socket/qabstractsocket.cpp
r651 r769 156 156 examples for an overview of both approaches. 157 157 158 \note We discourage the use of the blocking functions together 159 with signals. One of the two possibilities should be used. 160 158 161 QAbstractSocket can be used with QTextStream and QDataStream's 159 162 stream operators (operator<<() and operator>>()). There is one … … 170 173 the host lookup has succeeded. 171 174 175 \note Since Qt 4.6.3 QAbstractSocket may emit hostFound() 176 directly from the connectToHost() call since a DNS result could have been 177 cached. 178 172 179 \sa connected() 173 180 */ … … 178 185 This signal is emitted after connectToHost() has been called and 179 186 a connection has been successfully established. 187 188 \note On some operating systems the connected() signal may 189 be directly emitted from the connectToHost() call for connections 190 to the localhost. 180 191 181 192 \sa connectToHost(), disconnected() … … 352 363 #include "qabstractsocket_p.h" 353 364 365 #include "private/qhostinfo_p.h" 366 354 367 #include <qabstracteventdispatcher.h> 355 368 #include <qdatetime.h> … … 1367 1380 #endif 1368 1381 } else { 1369 if (d->threadData->eventDispatcher) 1370 d->hostLookupId = QHostInfo::lookupHost(hostName, this, SLOT(_q_startConnecting(QHostInfo))); 1382 if (d->threadData->eventDispatcher) { 1383 // this internal API for QHostInfo either immediatly gives us the desired 1384 // QHostInfo from cache or later calls the _q_startConnecting slot. 1385 bool immediateResultValid = false; 1386 QHostInfo hostInfo = qt_qhostinfo_lookup(hostName, 1387 this, 1388 SLOT(_q_startConnecting(QHostInfo)), 1389 &immediateResultValid, 1390 &d->hostLookupId); 1391 if (immediateResultValid) { 1392 d->hostLookupId = -1; 1393 d->_q_startConnecting(hostInfo); 1394 } 1395 } 1371 1396 } 1372 1397 … … 1683 1708 If msecs is -1, this function will not time out. 1684 1709 1685 Note:This function may wait slightly longer than \a msecs,1710 \note This function may wait slightly longer than \a msecs, 1686 1711 depending on the time it takes to complete the host lookup. 1712 1713 \note Multiple calls to this functions do not accumulate the time. 1714 If the function times out, the connecting process will be aborted. 1687 1715 1688 1716 \sa connectToHost(), connected() … … 1723 1751 } 1724 1752 if (state() == UnconnectedState) 1725 return false; 1753 return false; // connect not im progress anymore! 1726 1754 1727 1755 bool timedOut = true; … … 2355 2383 qDebug("QAbstractSocket::disconnectFromHost() aborting immediately"); 2356 2384 #endif 2385 if (d->state == HostLookupState) { 2386 QHostInfo::abortHostLookup(d->hostLookupId); 2387 d->hostLookupId = -1; 2388 } 2357 2389 } else { 2358 2390 // Perhaps emit closing()
Note:
See TracChangeset
for help on using the changeset viewer.