Qt 4.8
Public Functions | Public Variables | List of all members
QTcpServerPrivate Class Reference
Inheritance diagram for QTcpServerPrivate:
QObjectPrivate QAbstractSocketEngineReceiver QObjectData

Public Functions

void connectionNotification ()
 
void exceptionNotification ()
 
void proxyAuthenticationRequired (const QNetworkProxy &, QAuthenticator *)
 
 QTcpServerPrivate ()
 
void readNotification ()
 
QNetworkProxy resolveProxy (const QHostAddress &address, quint16 port)
 Resolve the proxy to its final value. More...
 
void writeNotification ()
 
 ~QTcpServerPrivate ()
 
- Public Functions inherited from QObjectPrivate
void _q_reregisterTimers (void *pointer)
 
void addConnection (int signal, Connection *c)
 
void cleanConnectionLists ()
 
void connectNotify (const char *signal)
 
void deleteChildren ()
 
void disconnectNotify (const char *signal)
 
bool isSender (const QObject *receiver, const char *signal) const
 
bool isSignalConnected (uint signalIdx) const
 Returns true if the signal with index signal_index from object sender is connected. More...
 
void moveToThread_helper ()
 
 QObjectPrivate (int version=QObjectPrivateVersion)
 
QObjectList receiverList (const char *signal) const
 
QObjectList senderList () const
 
void setParent_helper (QObject *)
 
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData)
 
int signalIndex (const char *signalName) const
 Returns the signal index used in the internal connectionLists vector. More...
 
virtual ~QObjectPrivate ()
 
- Public Functions inherited from QObjectData
virtual ~QObjectData ()=0
 
- Public Functions inherited from QAbstractSocketEngineReceiver
virtual ~QAbstractSocketEngineReceiver ()
 

Public Variables

QHostAddress address
 
int maxConnections
 
QList< QTcpSocket * > pendingConnections
 
quint16 port
 
QNetworkProxy proxy
 
QAbstractSocket::SocketError serverSocketError
 
QString serverSocketErrorString
 
QAbstractSocketEnginesocketEngine
 
QAbstractSocket::SocketState state
 
- Public Variables inherited from QObjectPrivate
union {
   QObject *   currentChildBeingDeleted
 
   QAbstractDeclarativeData *   declarativeData
 
}; 
 
quint32 connectedSignals [2]
 
QObjectConnectionListVectorconnectionLists
 
SendercurrentSender
 
QList< QPointer< QObject > > eventFilters
 
ExtraDataextraData
 
QString objectName
 
Connectionsenders
 
QAtomicPointer< QtSharedPointer::ExternalRefCountData > sharedRefcount
 
QThreadDatathreadData
 
void * unused
 
- Public Variables inherited from QObjectData
uint blockSig: 1
 
QObjectList children
 
uint hasGuards: 1
 
uint inEventHandler: 1
 
uint inThreadChangeEvent: 1
 
uint isWidget: 1
 
QMetaObjectmetaObject
 
uint ownObjectName: 1
 
QObjectparent
 
uint pendTimer: 1
 
int postedEvents
 
QObjectq_ptr
 
uint receiveChildEvents: 1
 
uint sendChildEvents: 1
 
uint unused: 22
 
uint wasDeleted: 1
 

Additional Inherited Members

- Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
 
- Static Public Functions inherited from QObjectPrivate
static void clearGuards (QObject *)
 
static QObjectPrivateget (QObject *o)
 
static void resetCurrentSender (QObject *receiver, Sender *currentSender, Sender *previousSender)
 
static SendersetCurrentSender (QObject *receiver, Sender *sender)
 
static void signalSignature (const QMetaMethod &signal, QVarLengthArray< char > *result)
 

Detailed Description

Definition at line 126 of file qtcpserver.cpp.

Constructors and Destructors

◆ QTcpServerPrivate()

QTcpServerPrivate::QTcpServerPrivate ( )
Warning
This function is not part of the public interface.

Definition at line 164 of file qtcpserver.cpp.

◆ ~QTcpServerPrivate()

QTcpServerPrivate::~QTcpServerPrivate ( )
Warning
This function is not part of the public interface.

Definition at line 175 of file qtcpserver.cpp.

176 {
177 }

Functions

◆ connectionNotification()

void QTcpServerPrivate::connectionNotification ( )
inlinevirtual

Implements QAbstractSocketEngineReceiver.

Definition at line 155 of file qtcpserver.cpp.

155 {}

◆ exceptionNotification()

void QTcpServerPrivate::exceptionNotification ( )
inlinevirtual

Implements QAbstractSocketEngineReceiver.

Definition at line 154 of file qtcpserver.cpp.

154 {}

◆ proxyAuthenticationRequired()

void QTcpServerPrivate::proxyAuthenticationRequired ( const QNetworkProxy ,
QAuthenticator  
)
inlinevirtual

Implements QAbstractSocketEngineReceiver.

Definition at line 157 of file qtcpserver.cpp.

157 {}

◆ readNotification()

void QTcpServerPrivate::readNotification ( )
virtual
Warning
This function is not part of the public interface.

Implements QAbstractSocketEngineReceiver.

Definition at line 217 of file qtcpserver.cpp.

218 {
219  Q_Q(QTcpServer);
220  for (;;) {
222 #if defined (QTCPSERVER_DEBUG)
223  qDebug("QTcpServerPrivate::_q_processIncomingConnection() too many connections");
224 #endif
227  return;
228  }
229 
230  int descriptor = socketEngine->accept();
231  if (descriptor == -1)
232  break;
233 #if defined (QTCPSERVER_DEBUG)
234  qDebug("QTcpServerPrivate::_q_processIncomingConnection() accepted socket %i", descriptor);
235 #endif
236  q->incomingConnection(descriptor);
237 
238  QPointer<QTcpServer> that = q;
239  emit q->newConnection();
240  if (!that || !q->isListening())
241  return;
242  }
243 }
virtual bool isReadNotificationEnabled() const =0
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
virtual int accept()=0
bool isListening() const
Returns true if the server is currently listening for incoming connections; otherwise returns false...
Definition: qtcpserver.cpp:358
The QPointer class is a template class that provides guarded pointers to QObject. ...
Definition: qpointer.h:54
QAbstractSocketEngine * socketEngine
Definition: qtcpserver.cpp:139
#define Q_Q(Class)
Definition: qglobal.h:2483
Q_CORE_EXPORT void qDebug(const char *,...)
#define emit
Definition: qobjectdefs.h:76
The QTcpServer class provides a TCP-based server.
Definition: qtcpserver.h:61
virtual void setReadNotificationEnabled(bool enable)=0
QList< QTcpSocket * > pendingConnections
Definition: qtcpserver.cpp:133

◆ resolveProxy()

QNetworkProxy QTcpServerPrivate::resolveProxy ( const QHostAddress address,
quint16  port 
)

Resolve the proxy to its final value.

Warning
This function is not part of the public interface.

Definition at line 187 of file qtcpserver.cpp.

188 {
189  if (address == QHostAddress::LocalHost ||
190  address == QHostAddress::LocalHostIPv6)
191  return QNetworkProxy::NoProxy;
192 
193  QList<QNetworkProxy> proxies;
195  // a non-default proxy was set with setProxy
196  proxies << proxy;
197  } else {
198  // try the application settings instead
200  proxies = QNetworkProxyFactory::proxyForQuery(query);
201  }
202 
203  // return the first that we can use
204  foreach (const QNetworkProxy &p, proxies) {
206  return p;
207  }
208 
209  // no proxy found
210  // DefaultProxy will raise an error
212 }
QNetworkProxy::ProxyType type() const
Returns the proxy type for this instance.
The QString class provides a Unicode character string.
Definition: qstring.h:83
static QList< QNetworkProxy > proxyForQuery(const QNetworkProxyQuery &query)
This function takes the query request, query, examines the details of the type of socket or request a...
The QNetworkProxy class provides a network layer proxy.
Capabilities capabilities() const
Returns the capabilities of this proxy server.
The QNetworkProxyQuery class is used to query the proxy settings for a socket.
Definition: qnetworkproxy.h:60
QNetworkProxy proxy
Definition: qtcpserver.cpp:147

◆ writeNotification()

void QTcpServerPrivate::writeNotification ( )
inlinevirtual

Implements QAbstractSocketEngineReceiver.

Definition at line 153 of file qtcpserver.cpp.

153 {}

Properties

◆ address

QHostAddress QTcpServerPrivate::address

Definition at line 136 of file qtcpserver.cpp.

◆ maxConnections

int QTcpServerPrivate::maxConnections

Definition at line 144 of file qtcpserver.cpp.

Referenced by readNotification().

◆ pendingConnections

QList<QTcpSocket *> QTcpServerPrivate::pendingConnections

Definition at line 133 of file qtcpserver.cpp.

Referenced by readNotification().

◆ port

quint16 QTcpServerPrivate::port

Definition at line 135 of file qtcpserver.cpp.

◆ proxy

QNetworkProxy QTcpServerPrivate::proxy

Definition at line 147 of file qtcpserver.cpp.

Referenced by resolveProxy().

◆ serverSocketError

QAbstractSocket::SocketError QTcpServerPrivate::serverSocketError

Definition at line 141 of file qtcpserver.cpp.

◆ serverSocketErrorString

QString QTcpServerPrivate::serverSocketErrorString

Definition at line 142 of file qtcpserver.cpp.

◆ socketEngine

QAbstractSocketEngine* QTcpServerPrivate::socketEngine

Definition at line 139 of file qtcpserver.cpp.

Referenced by readNotification().

◆ state

QAbstractSocket::SocketState QTcpServerPrivate::state

Definition at line 138 of file qtcpserver.cpp.


The documentation for this class was generated from the following file: