Home · Modules · Classes · Namespaces · Functions

QxtAbstractConnectionManager Class Reference
[QxtCore module]

The QxtAbstractConnectionManager class is an interface for classes that maintain connection pools More...

    #include <QxtAbstractConnectionManager>

Inherits QObject.

Inherited by QxtTcpConnectionManager.

Public Functions

Public Slots

Protected Functions

Additional Inherited Members


Detailed Description

The QxtAbstractConnectionManager class is an interface for classes that maintain connection pools

QxtAbstractConnectionManager is a standardized interface for accepting and tracking incoming connections.

Each incoming connection is assigned an arbitrary, opaque client ID number. This number can be used to retrieve the QIODevice associated with it. A list of IDs for all current connections can be retrieved with the clients() function.

As an abstract class, QxtAbstractConnectionManager cannot be used on its own. Subclasses must implement isAcceptingConnections() to indicate the current listening status of the connection manager and removeConnection() to perform necessary clean-up of an established connection before disconnecting. Finally, a subclass must invoke addConnection() after a new incoming connection has been established and prepared.

See also QxtTcpConnectionManager.


Member Function Documentation

QxtAbstractConnectionManager::QxtAbstractConnectionManager ( QObject * parent )

Constructs a QxtAbstractConnectionManager object with the specified parent.

QxtAbstractConnectionManager::~QxtAbstractConnectionManager ()   [virtual]

Destructs the connection manager.

void QxtAbstractConnectionManager::addConnection ( QIODevice * device, quint64 clientID )   [protected]

Begins managing a connection. Each device must have a unique, non-zero clientID, but beyond this constraint implementations may use any convenient value. Implementations should invoke this function after establishing a usable connection and performing any desired initial negotiation.

This function will emit the newConnection signal after the internal data structures have been suitably updated.

QIODevice * QxtAbstractConnectionManager::client ( quint64 clientID ) const

Returns the QIODevice for the requested clientID.

int QxtAbstractConnectionManager::clientCount () const

Returns the number of connected clients.

QList<quint64> QxtAbstractConnectionManager::clients () const

Returns a list of client IDs for all connected clients.

void QxtAbstractConnectionManager::disconnect ( quint64 clientID )   [slot]

Disconnects the connection with the specified clientID.

Implementations should invoke this function when the connection should no longer be used; for instance, when the QIODevice object is destroyed or the connection has been closed. Code that uses the connection manager service should invoke this function to close a connection on demand.


Copyright © 2007-2010 Qxt Foundation
Qxt 0.6.1