Logo Search packages:      
Sourcecode: qt4-x11 version File versions

QLocalSocket * QLocalServer::nextPendingConnection (  )  [virtual]

Returns the next pending connection as a connected QLocalSocket object.

The socket is created as a child of the server, which means that it is automatically deleted when the QLocalServer object is destroyed. It is still a good idea to delete the object explicitly when you are done with it, to avoid wasting memory.

0 is returned if this function is called when there are no pending connections.

See also:
hasPendingConnections(), newConnection(), incomingConnection()

Definition at line 275 of file qlocalserver.cpp.

Referenced by Server::sendFortune().

{
    Q_D(QLocalServer);
    if (d->pendingConnections.isEmpty())
        return 0;
    QLocalSocket *nextSocket = d->pendingConnections.dequeue();
#ifndef Q_OS_WIN
    d->socketNotifier->setEnabled(d->pendingConnections.size()
                                   <= d->maxPendingConnections);
#endif
    return nextSocket;
}


Generated by  Doxygen 1.6.0   Back to index