From ca205818b4981dc14ae191f7085c4997b20d55cb Mon Sep 17 00:00:00 2001 From: Kurt Pattyn Date: Sun, 25 Aug 2013 15:23:30 +0200 Subject: [PATCH] Reordered the lines a bit --- src/qwebsocketserver.h | 26 +++++++++++++++++--------- src/qwebsocketserver_p.cpp | 1 + 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/qwebsocketserver.h b/src/qwebsocketserver.h index 424221e..17e0f80 100644 --- a/src/qwebsocketserver.h +++ b/src/qwebsocketserver.h @@ -26,22 +26,30 @@ public: 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; diff --git a/src/qwebsocketserver_p.cpp b/src/qwebsocketserver_p.cpp index ee3ef9f..d96cc6c 100644 --- a/src/qwebsocketserver_p.cpp +++ b/src/qwebsocketserver_p.cpp @@ -23,6 +23,7 @@ QWebSocketServerPrivate::QWebSocketServerPrivate(const QString &serverName, QWeb { 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())); } -- 2.7.4