QxtTcpConnectionManager Class Reference
[QxtNetwork module]

Accepts TCP connections and maintains a connection pool. More...

 #include <QxtTcpConnectionManager>

Inherits QxtAbstractConnectionManager.

Public Functions

Protected Functions


Detailed Description

QxtTcpConnectionManager is a standardized interface for accepting and tracking incoming TCP connections.

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

Like QTcpServer, QxtTcpConnectionManager can listen for incoming connections on a specified interface and port, and like QTcpServer you may override the incomingConnection() function to change the handling of new connections. This is, for instance, where you would create a QSslSocket to encrypt communications.

see See also: QTcpServer

Member Documentation

QxtTcpConnectionManager ( QObject * parent )

Constructs a new QxtTcpConnectionManager object with the specified parent.




bool listen ( QHostAddress iface = QHostAddress::Any , int port = 80 )

Listens on the specified interface on the specified port for connections. If address is QHostAddress::Any, listens on all interfaces.

Returns true on success; otherwise returns false.




void stopListening ( )

Stops listening for connections. Any connections still open will remain connected.




void setProxy ( const QNetworkProxy & proxy )

Sets an explicit network proxy for the connection manager.

see See also: QTcpServer::setProxy




QNetworkProxy proxy ( ) const

Returns the proxy in use for the connection manager.

see See also: QTcpServer::proxy




virtual QIODevice * incomingConnection ( int socketDescriptor )

This function is called when a new TCP connection becomes available. The parameter is the native socket descriptor for the connection, suitable for use in QTcpSocket::setSocketDescriptor.

The default implementation returns a new QTcpSocket with the specified descriptor. Subclasses may return QTcpSocket subclasses, such as QSslSocket.






Copyright © 2007 Qxt Foundation Trademarks
Qt Extension Library 0.4