summaryrefslogtreecommitdiffstats
path: root/src/network/socket/qtcpserver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/socket/qtcpserver.cpp')
-rw-r--r--src/network/socket/qtcpserver.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/network/socket/qtcpserver.cpp b/src/network/socket/qtcpserver.cpp
index 47a998c..404eee7 100644
--- a/src/network/socket/qtcpserver.cpp
+++ b/src/network/socket/qtcpserver.cpp
@@ -513,6 +513,10 @@ bool QTcpServer::hasPendingConnections() const
0 is returned if this function is called when there are no pending
connections.
+ \note The returned QTcpSocket object cannot be used from another
+ thread. If you want to use an incoming connection from another thread,
+ you need to override incomingConnection().
+
\sa hasPendingConnections()
*/
QTcpSocket *QTcpServer::nextPendingConnection()
@@ -543,6 +547,11 @@ QTcpSocket *QTcpServer::nextPendingConnection()
may not be usable with native socket functions, and should only be
used with QTcpSocket::setSocketDescriptor().
+ \note If you want to handle an incoming connection as a new QTcpSocket
+ object in another thread you have to pass the socketDescriptor
+ to the other thread and create the QTcpSocket object there and
+ use its setSocketDescriptor() method.
+
\sa newConnection(), nextPendingConnection()
*/
void QTcpServer::incomingConnection(int socketDescriptor)