equal
deleted
inserted
replaced
1 /**************************************************************************** |
1 /**************************************************************************** |
2 ** |
2 ** |
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
4 ** All rights reserved. |
4 ** All rights reserved. |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
6 ** |
6 ** |
7 ** This file is part of the QtNetwork module of the Qt Toolkit. |
7 ** This file is part of the QtNetwork module of the Qt Toolkit. |
8 ** |
8 ** |
511 explicitly when you are done with it, to avoid wasting memory. |
511 explicitly when you are done with it, to avoid wasting memory. |
512 |
512 |
513 0 is returned if this function is called when there are no pending |
513 0 is returned if this function is called when there are no pending |
514 connections. |
514 connections. |
515 |
515 |
|
516 \note The returned QTcpSocket object cannot be used from another |
|
517 thread. If you want to use an incoming connection from another thread, |
|
518 you need to override incomingConnection(). |
|
519 |
516 \sa hasPendingConnections() |
520 \sa hasPendingConnections() |
517 */ |
521 */ |
518 QTcpSocket *QTcpServer::nextPendingConnection() |
522 QTcpSocket *QTcpServer::nextPendingConnection() |
519 { |
523 { |
520 Q_D(QTcpServer); |
524 Q_D(QTcpServer); |
540 connection is available. |
544 connection is available. |
541 |
545 |
542 If this server is using QNetworkProxy then the \a socketDescriptor |
546 If this server is using QNetworkProxy then the \a socketDescriptor |
543 may not be usable with native socket functions, and should only be |
547 may not be usable with native socket functions, and should only be |
544 used with QTcpSocket::setSocketDescriptor(). |
548 used with QTcpSocket::setSocketDescriptor(). |
|
549 |
|
550 \note If you want to handle an incoming connection as a new QTcpSocket |
|
551 object in another thread you have to pass the socketDescriptor |
|
552 to the other thread and create the QTcpSocket object there and |
|
553 use its setSocketDescriptor() method. |
545 |
554 |
546 \sa newConnection(), nextPendingConnection() |
555 \sa newConnection(), nextPendingConnection() |
547 */ |
556 */ |
548 void QTcpServer::incomingConnection(int socketDescriptor) |
557 void QTcpServer::incomingConnection(int socketDescriptor) |
549 { |
558 { |