Check return value of listen and set appropriate error and description
authorKurt Pattyn <pattyn.kurt@gmail.com>
Sun, 2 Feb 2014 17:25:42 +0000 (18:25 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Sun, 2 Feb 2014 21:00:33 +0000 (22:00 +0100)
Change-Id: I2309a51d873812cdc590b5d846a84024b6e28857
Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
src/websockets/qwebsocketserver_p.cpp

index 00c868b..47f24d2 100644 (file)
@@ -158,7 +158,10 @@ bool QWebSocketServerPrivate::isListening() const
  */
 bool QWebSocketServerPrivate::listen(const QHostAddress &address, quint16 port)
 {
-    return m_pTcpServer->listen(address, port);
+    bool success = m_pTcpServer->listen(address, port);
+    if (!success)
+        setErrorFromSocketError(m_pTcpServer->serverError(), m_pTcpServer->errorString());
+    return success;
 }
 
 /*!