Changeset 846 for trunk/src/network/socket
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 34 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/network/socket/qabstractsocket.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 366 366 367 367 #include <qabstracteventdispatcher.h> 368 #include <qdatetime.h>369 368 #include <qhostaddress.h> 370 369 #include <qhostinfo.h> … … 372 371 #include <qpointer.h> 373 372 #include <qtimer.h> 373 #include <qelapsedtimer.h> 374 374 375 375 #ifndef QT_NO_OPENSSL … … 1213 1213 } 1214 1214 1215 1216 void QAbstractSocketPrivate::pauseSocketNotifiers(QAbstractSocket *socket) 1217 { 1218 QAbstractSocketEngine *socketEngine = socket->d_func()->socketEngine; 1219 if (!socketEngine) 1220 return; 1221 socket->d_func()->prePauseReadSocketNotifierState = socketEngine->isReadNotificationEnabled(); 1222 socket->d_func()->prePauseWriteSocketNotifierState = socketEngine->isWriteNotificationEnabled(); 1223 socket->d_func()->prePauseExceptionSocketNotifierState = socketEngine->isExceptionNotificationEnabled(); 1224 socketEngine->setReadNotificationEnabled(false); 1225 socketEngine->setWriteNotificationEnabled(false); 1226 socketEngine->setExceptionNotificationEnabled(false); 1227 } 1228 1229 void QAbstractSocketPrivate::resumeSocketNotifiers(QAbstractSocket *socket) 1230 { 1231 QAbstractSocketEngine *socketEngine = socket->d_func()->socketEngine; 1232 if (!socketEngine) 1233 return; 1234 socketEngine->setReadNotificationEnabled(socket->d_func()->prePauseReadSocketNotifierState); 1235 socketEngine->setWriteNotificationEnabled(socket->d_func()->prePauseWriteSocketNotifierState); 1236 socketEngine->setExceptionNotificationEnabled(socket->d_func()->prePauseExceptionSocketNotifierState); 1237 } 1238 1239 QAbstractSocketEngine* QAbstractSocketPrivate::getSocketEngine(QAbstractSocket *socket) 1240 { 1241 return socket->d_func()->socketEngine; 1242 } 1243 1244 1215 1245 /*! \internal 1216 1246 … … 1381 1411 } else { 1382 1412 if (d->threadData->eventDispatcher) { 1383 // this internal API for QHostInfo either immediat ly gives us the desired1413 // this internal API for QHostInfo either immediately gives us the desired 1384 1414 // QHostInfo from cache or later calls the _q_startConnecting slot. 1385 1415 bool immediateResultValid = false; … … 1739 1769 bool wasPendingClose = d->pendingClose; 1740 1770 d->pendingClose = false; 1741 Q TimestopWatch;1771 QElapsedTimer stopWatch; 1742 1772 stopWatch.start(); 1743 1773 … … 1820 1850 } 1821 1851 1822 Q TimestopWatch;1852 QElapsedTimer stopWatch; 1823 1853 stopWatch.start(); 1824 1854 … … 1879 1909 return false; 1880 1910 1881 Q TimestopWatch;1911 QElapsedTimer stopWatch; 1882 1912 stopWatch.start(); 1883 1913 … … 1961 1991 } 1962 1992 1963 Q TimestopWatch;1993 QElapsedTimer stopWatch; 1964 1994 stopWatch.start(); 1965 1995 -
trunk/src/network/socket/qabstractsocket.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/network/socket/qabstractsocket_p.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 159 159 160 160 QAbstractSocket::SocketError socketError; 161 162 bool prePauseReadSocketNotifierState; 163 bool prePauseWriteSocketNotifierState; 164 bool prePauseExceptionSocketNotifierState; 165 static void pauseSocketNotifiers(QAbstractSocket*); 166 static void resumeSocketNotifiers(QAbstractSocket*); 167 static QAbstractSocketEngine* getSocketEngine(QAbstractSocket*); 161 168 }; 162 169 -
trunk/src/network/socket/qabstractsocketengine.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/network/socket/qabstractsocketengine_p.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/network/socket/qhttpsocketengine.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 43 43 #include "qtcpsocket.h" 44 44 #include "qhostaddress.h" 45 #include "qdatetime.h"46 45 #include "qurl.h" 47 46 #include "qhttp.h" 47 #include "qelapsedtimer.h" 48 48 49 49 #if !defined(QT_NO_NETWORKPROXY) && !defined(QT_NO_HTTP) … … 320 320 return false; 321 321 322 Q TimestopWatch;322 QElapsedTimer stopWatch; 323 323 stopWatch.start(); 324 324 … … 367 367 } 368 368 369 Q TimestopWatch;369 QElapsedTimer stopWatch; 370 370 stopWatch.start(); 371 371 -
trunk/src/network/socket/qhttpsocketengine_p.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/network/socket/qlocalserver.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/network/socket/qlocalserver.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/network/socket/qlocalserver_p.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 100 100 HANDLE handle; 101 101 OVERLAPPED overlapped; 102 bool connected; 102 103 }; 103 104 -
trunk/src/network/socket/qlocalserver_tcp.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/network/socket/qlocalserver_unix.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 120 120 // 121 121 // This change can be removed once more generic fix to select thread 122 // sync ronization problem is implemented.122 // synchronization problem is implemented. 123 123 int flags = fcntl(listenSocket, F_GETFL, 0); 124 124 if (-1 == flags -
trunk/src/network/socket/qlocalserver_win.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 66 66 (const wchar_t *)fullServerName.utf16(), // pipe name 67 67 PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, // read/write access 68 PIPE_TYPE_ MESSAGE | // message type pipe69 PIPE_READMODE_ MESSAGE | // message-read mode68 PIPE_TYPE_BYTE | // byte type pipe 69 PIPE_READMODE_BYTE | // byte-read mode 70 70 PIPE_WAIT, // blocking mode 71 71 PIPE_UNLIMITED_INSTANCES, // max. instances … … 86 86 switch (GetLastError()) { 87 87 case ERROR_IO_PENDING: 88 listener.connected = false; 88 89 break; 89 90 case ERROR_PIPE_CONNECTED: 91 listener.connected = true; 90 92 SetEvent(eventHandle); 91 93 break; … … 156 158 for (int i = 0; i < listeners.size(); ) { 157 159 HANDLE handle = listeners[i].handle; 158 if (GetOverlappedResult(handle, &listeners[i].overlapped, &dummy, FALSE)) { 160 if (listeners[i].connected 161 || GetOverlappedResult(handle, &listeners[i].overlapped, &dummy, FALSE)) 162 { 159 163 listeners.removeAt(i); 160 164 -
trunk/src/network/socket/qlocalsocket.cpp
r755 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/network/socket/qlocalsocket.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/network/socket/qlocalsocket_p.h
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 136 136 void _q_pipeClosed(); 137 137 void _q_emitReadyRead(); 138 DWORD bytesAvailable();138 DWORD checkPipeState(); 139 139 void startAsyncRead(); 140 140 bool completeAsyncRead(); -
trunk/src/network/socket/qlocalsocket_tcp.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/network/socket/qlocalsocket_unix.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 53 53 #include <errno.h> 54 54 55 #include <qdatetime.h>56 55 #include <qdir.h> 57 56 #include <qdebug.h> 57 #include <qelapsedtimer.h> 58 58 59 59 #ifdef Q_OS_VXWORKS … … 535 535 int result = -1; 536 536 // on Linux timeout will be updated by select, but _not_ on other systems. 537 Q Timetimer;537 QElapsedTimer timer; 538 538 timer.start(); 539 539 while (state() == ConnectingState -
trunk/src/network/socket/qlocalsocket_win.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 193 193 Q_D(QLocalSocket); 194 194 195 if (d->pipeClosed && d->actualReadBufferSize == 0) 196 return -1; // signal EOF 197 195 198 qint64 readSoFar; 196 199 // If startAsyncRead() read data, copy it to its destination. … … 214 217 215 218 if (d->pipeClosed) { 216 if ( readSoFar == 0) {219 if (d->actualReadBufferSize == 0) 217 220 QTimer::singleShot(0, this, SLOT(_q_pipeClosed())); 218 return -1; // signal EOF219 }220 221 } else { 221 222 if (!d->readSequenceStarted) … … 251 252 { 252 253 do { 253 DWORD bytesToRead = bytesAvailable(); 254 DWORD bytesToRead = checkPipeState(); 255 if (pipeClosed) 256 return; 257 254 258 if (bytesToRead == 0) { 255 259 // There are no bytes in the pipe but we need to … … 277 281 // This is not an error. We're getting notified, when data arrives. 278 282 return; 283 case ERROR_MORE_DATA: 284 // This is not an error. The synchronous read succeeded. 285 // We're connected to a message mode pipe and the message 286 // didn't fit into the pipe's system buffer. 287 completeAsyncRead(); 288 break; 279 289 case ERROR_PIPE_NOT_CONNECTED: 280 290 { … … 297 307 \internal 298 308 Sets the correct size of the read buffer after a read operation. 299 Returns false, if an error occur ed or the connection dropped.309 Returns false, if an error occurred or the connection dropped. 300 310 */ 301 311 bool QLocalSocketPrivate::completeAsyncRead() … … 306 316 DWORD bytesRead; 307 317 if (!GetOverlappedResult(handle, &overlapped, &bytesRead, TRUE)) { 308 if (GetLastError() != ERROR_PIPE_NOT_CONNECTED) 318 switch (GetLastError()) { 319 case ERROR_MORE_DATA: 320 // This is not an error. We're connected to a message mode 321 // pipe and the message didn't fit into the pipe's system 322 // buffer. We will read the remaining data in the next call. 323 break; 324 case ERROR_PIPE_NOT_CONNECTED: 325 return false; 326 default: 309 327 setErrorString(QLatin1String("QLocalSocketPrivate::completeAsyncRead")); 310 return false; 328 return false; 329 } 311 330 } 312 331 … … 334 353 335 354 /*! 336 The number of bytes available from the pipe 337 */ 338 DWORD QLocalSocketPrivate::bytesAvailable() 355 \internal 356 Returns the number of available bytes in the pipe. 357 Sets QLocalSocketPrivate::pipeClosed to true if the connection is broken. 358 */ 359 DWORD QLocalSocketPrivate::checkPipeState() 339 360 { 340 361 Q_Q(QLocalSocket); … … 346 367 pipeClosed = true; 347 368 emit q->readChannelFinished(); 348 QTimer::singleShot(0, q, SLOT(_q_pipeClosed())); 369 if (actualReadBufferSize == 0) 370 QTimer::singleShot(0, q, SLOT(_q_pipeClosed())); 349 371 } 350 372 } … … 479 501 pipeClosed = true; 480 502 emit q->readChannelFinished(); 503 if (actualReadBufferSize == 0) 504 QTimer::singleShot(0, q, SLOT(_q_pipeClosed())); 481 505 return; 482 506 } … … 530 554 QIncrementalSleepTimer timer(msecs); 531 555 forever { 532 d-> bytesAvailable(); // to check if PeekNamedPipe fails556 d->checkPipeState(); 533 557 if (d->pipeClosed) 534 558 close(); … … 562 586 return false; 563 587 588 // We already know that the pipe is gone, but did not enter the event loop yet. 589 if (d->pipeClosed) { 590 close(); 591 return false; 592 } 593 564 594 Q_ASSERT(d->readSequenceStarted); 565 595 DWORD result = WaitForSingleObject(d->overlapped.hEvent, msecs == -1 ? INFINITE : msecs); … … 567 597 case WAIT_OBJECT_0: 568 598 d->_q_notified(); 599 // We just noticed that the pipe is gone. 600 if (d->pipeClosed) { 601 close(); 602 return false; 603 } 569 604 return true; 570 605 case WAIT_TIMEOUT: -
trunk/src/network/socket/qnativesocketengine.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 186 186 // one exception: SocketError(11) bypasses this as it's purely 187 187 // a temporary internal error condition. 188 // Another exception is the way the waitFor*() functions set 189 // an error when a timeout occurs. After the call to setError() 190 // they reset the hasSetSocketError to false 188 191 return; 189 192 } … … 860 863 d->setError(QAbstractSocket::SocketTimeoutError, 861 864 QNativeSocketEnginePrivate::TimeOutErrorString); 865 d->hasSetSocketError = false; // A timeout error is temporary in waitFor functions 862 866 return false; 863 867 } else if (state() == QAbstractSocket::ConnectingState) { … … 928 932 d->setError(QAbstractSocket::SocketTimeoutError, 929 933 QNativeSocketEnginePrivate::TimeOutErrorString); 934 d->hasSetSocketError = false; // A timeout error is temporary in waitFor functions 930 935 return false; 931 936 } else if (state() == QAbstractSocket::ConnectingState) { … … 979 984 d->setError(QAbstractSocket::SocketTimeoutError, 980 985 QNativeSocketEnginePrivate::TimeOutErrorString); 986 d->hasSetSocketError = false; // A timeout error is temporary in waitFor functions 981 987 return false; 982 988 } else if (state() == QAbstractSocket::ConnectingState) { -
trunk/src/network/socket/qnativesocketengine_p.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/network/socket/qnativesocketengine_unix.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 45 45 #include "qiodevice.h" 46 46 #include "qhostaddress.h" 47 #include "qelapsedtimer.h" 47 48 #include "qvarlengtharray.h" 48 #include "qdatetime.h"49 49 #include <time.h> 50 50 #include <errno.h> … … 203 203 } 204 204 205 // Ensure that the socket is closed on exec*().206 ::fcntl(socket, F_SETFD, FD_CLOEXEC);207 208 205 socketDescriptor = socket; 209 206 return true; … … 353 350 sockAddrIPv6.sin6_family = AF_INET6; 354 351 sockAddrIPv6.sin6_port = htons(port); 352 353 QString scopeid = addr.scopeId(); 354 bool ok; 355 sockAddrIPv6.sin6_scope_id = scopeid.toInt(&ok); 355 356 #ifndef QT_NO_IPV6IFNAME 356 sockAddrIPv6.sin6_scope_id = ::if_nametoindex(addr.scopeId().toLatin1().data()); 357 #else 358 sockAddrIPv6.sin6_scope_id = addr.scopeId().toInt(); 357 if (!ok) 358 sockAddrIPv6.sin6_scope_id = ::if_nametoindex(scopeid.toLatin1()); 359 359 #endif 360 360 Q_IPV6ADDR ip6 = addr.toIPv6Address(); … … 426 426 case EFAULT: 427 427 case ENOTSOCK: 428 #ifdef Q_OS_SYMBIAN 429 case EPIPE: 430 #endif 428 431 socketState = QAbstractSocket::UnconnectedState; 429 432 default: … … 559 562 #else 560 563 int acceptedDescriptor = qt_safe_accept(socketDescriptor, 0, 0); 561 #endif562 //check if we have vaild descriptor at all563 if(acceptedDescriptor > 0) {564 // Ensure that the socket is closed on exec*()565 ::fcntl(acceptedDescriptor, F_SETFD, FD_CLOEXEC);566 }567 #ifdef Q_OS_SYMBIAN568 else {569 qWarning("QNativeSocketEnginePrivate::nativeAccept() - acceptedDescriptor <= 0");570 }571 564 #endif 572 565 … … 1009 1002 ret = qt_safe_select(socketDescriptor + 1, &fdread, &fdwrite, 0, timeout < 0 ? 0 : &tv); 1010 1003 #else 1011 Q Timetimer;1004 QElapsedTimer timer; 1012 1005 timer.start(); 1013 1006 -
trunk/src/network/socket/qnativesocketengine_win.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 208 208 memset(sockAddrIPv6, 0, sizeof(qt_sockaddr_in6)); 209 209 sockAddrIPv6->sin6_family = AF_INET6; 210 sockAddrIPv6->sin6_scope_id = address.scopeId().toInt(); 210 211 WSAHtons(socketDescriptor, port, &(sockAddrIPv6->sin6_port)); 211 212 Q_IPV6ADDR tmp = address.toIPv6Address(); … … 733 734 int acceptedDescriptor = WSAAccept(socketDescriptor, 0,0,0,0); 734 735 if (acceptedDescriptor != -1 && QAbstractEventDispatcher::instance()) { 735 // Bec uase of WSAAsyncSelect() WSAAccept returns a non blocking socket736 // Because of WSAAsyncSelect() WSAAccept returns a non blocking socket 736 737 // with the same attributes as the listening socket including the current 737 738 // WSAAsyncSelect(). To be able to change the socket to blocking mode the -
trunk/src/network/socket/qnet_unix_p.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/network/socket/qsocks5socketengine.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 50 50 #include "qhash.h" 51 51 #include "qqueue.h" 52 #include "q datetime.h"52 #include "qelapsedtimer.h" 53 53 #include "qmutex.h" 54 54 #include "qthread.h" … … 309 309 QHostAddress peerAddress; 310 310 quint16 peerPort; 311 Q DateTimetimeStamp;311 QElapsedTimer timeStamp; 312 312 }; 313 313 … … 370 370 // qDebug() << "delete it"; 371 371 } 372 bindData->timeStamp = QDateTime::currentDateTime();372 bindData->timeStamp.start(); 373 373 store.insert(socketDescriptor, bindData); 374 374 // start sweep timer if not started … … 413 413 while (it.hasNext()) { 414 414 it.next(); 415 if (it.value()->timeStamp. secsTo(QDateTime::currentDateTime()) > 350) {415 if (it.value()->timeStamp.hasExpired(350000)) { 416 416 QSOCKS5_DEBUG << "QSocks5BindStore removing JJJJ"; 417 417 it.remove(); … … 1356 1356 1357 1357 int msecs = SOCKS5_BLOCKING_BIND_TIMEOUT; 1358 Q TimestopWatch;1358 QElapsedTimer stopWatch; 1359 1359 stopWatch.start(); 1360 1360 d->data->controlSocket->connectToHost(d->proxyInfo.hostName(), d->proxyInfo.port()); … … 1456 1456 if (d->data->controlSocket->state() == QAbstractSocket::ConnectedState) { 1457 1457 int msecs = 100; 1458 Q TimestopWatch;1458 QElapsedTimer stopWatch; 1459 1459 stopWatch.start(); 1460 1460 while (!d->data->controlSocket->bytesToWrite()) { … … 1675 1675 UdpAssociateSuccess; 1676 1676 1677 Q TimestopWatch;1677 QElapsedTimer stopWatch; 1678 1678 stopWatch.start(); 1679 1679 … … 1700 1700 d->readNotificationActivated = false; 1701 1701 1702 Q TimestopWatch;1702 QElapsedTimer stopWatch; 1703 1703 stopWatch.start(); 1704 1704 … … 1750 1750 QSOCKS5_DEBUG << "waitForWrite" << msecs; 1751 1751 1752 Q TimestopWatch;1752 QElapsedTimer stopWatch; 1753 1753 stopWatch.start(); 1754 1754 -
trunk/src/network/socket/qsocks5socketengine_p.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/network/socket/qtcpserver.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 563 563 use its setSocketDescriptor() method. 564 564 565 \sa newConnection(), nextPendingConnection() 565 \sa newConnection(), nextPendingConnection(), addPendingConnection() 566 566 */ 567 567 void QTcpServer::incomingConnection(int socketDescriptor) … … 573 573 QTcpSocket *socket = new QTcpSocket(this); 574 574 socket->setSocketDescriptor(socketDescriptor); 575 addPendingConnection(socket); 576 } 577 578 /*! 579 This function is called by QTcpServer::incomingConnection() 580 to add the \a socket to the list of pending incoming connections. 581 582 \note Don't forget to call this member from reimplemented 583 incomingConnection() if you do not want to break the 584 Pending Connections mechanism. 585 586 \sa incomingConnection() 587 \since 4.7 588 */ 589 void QTcpServer::addPendingConnection(QTcpSocket* socket) 590 { 575 591 d_func()->pendingConnections.append(socket); 576 592 } -
trunk/src/network/socket/qtcpserver.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 94 94 protected: 95 95 virtual void incomingConnection(int handle); 96 void addPendingConnection(QTcpSocket* socket); 96 97 97 98 Q_SIGNALS: -
trunk/src/network/socket/qtcpsocket.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/network/socket/qtcpsocket.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/network/socket/qtcpsocket_p.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/network/socket/qudpsocket.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/network/socket/qudpsocket.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com)
Note:
See TracChangeset
for help on using the changeset viewer.