explicit QWebSocketServer(const QString &serverName, QObject *parent = 0);
virtual ~QWebSocketServer();
+ bool listen(const QHostAddress &address = QHostAddress::Any, quint16 port = 0);
void close();
- QString errorString() const;
- bool hasPendingConnections() const;
+
bool isListening() const;
- bool listen(const QHostAddress &address = QHostAddress::Any, quint16 port = 0);
+
+ void setMaxPendingConnections(int numConnections);
int maxPendingConnections() const;
- virtual QWebSocket *nextPendingConnection();
- QNetworkProxy proxy() const;
- QHostAddress serverAddress() const;
- QAbstractSocket::SocketError serverError() const;
+
quint16 serverPort() const;
- void setMaxPendingConnections(int numConnections);
- void setProxy(const QNetworkProxy &networkProxy);
+ QHostAddress serverAddress() const;
+
bool setSocketDescriptor(int socketDescriptor);
int socketDescriptor() const;
+
bool waitForNewConnection(int msec = 0, bool *timedOut = 0);
+ bool hasPendingConnections() const;
+ virtual QWebSocket *nextPendingConnection();
+
+ QAbstractSocket::SocketError serverError() const;
+ QString errorString() const;
+
+ void pauseAccepting();
+ void resumeAccepting();
+
#ifndef QT_NO_NETWORKPROXY
void setProxy(const QNetworkProxy &networkProxy);
QNetworkProxy proxy() const;
{
Q_ASSERT(pWebSocketServer != 0);
m_pTcpServer = new QTcpServer(this);
+ connect(m_pTcpServer, SIGNAL(acceptError(QAbstractSocket::SocketError)), q_ptr, SIGNAL(acceptError(QAbstractSocket::SocketError)));
connect(m_pTcpServer, SIGNAL(newConnection()), this, SLOT(onNewConnection()));
}