src/network/socket/qtcpserver.cpp
changeset 30 5dc02b23752f
parent 22 79de32ba3296
child 33 3e2da88830cd
--- a/src/network/socket/qtcpserver.cpp	Wed Jun 23 19:07:03 2010 +0300
+++ b/src/network/socket/qtcpserver.cpp	Tue Jul 06 15:10:48 2010 +0300
@@ -562,7 +562,7 @@
     to the other thread and create the QTcpSocket object there and
     use its setSocketDescriptor() method.
 
-    \sa newConnection(), nextPendingConnection()
+    \sa newConnection(), nextPendingConnection(), addPendingConnection()
 */
 void QTcpServer::incomingConnection(int socketDescriptor)
 {
@@ -572,6 +572,22 @@
 
     QTcpSocket *socket = new QTcpSocket(this);
     socket->setSocketDescriptor(socketDescriptor);
+    addPendingConnection(socket);
+}
+
+/*!
+    This function is called by QTcpServer::incomingConnection()
+    to add a socket to the list of pending incoming connections.
+
+    \note Don't forget to call this member from reimplemented
+    incomingConnection() if you do not want to break the
+    Pending Connections mechanism.
+
+    \sa incomingConnection()
+    \since 4.7
+*/
+void QTcpServer::addPendingConnection(QTcpSocket* socket)
+{
     d_func()->pendingConnections.append(socket);
 }