Add handling/debug output for connection errors in the websocket server.

This commit is contained in:
Ken Moore
2016-01-19 14:49:46 -05:00
parent 27ebde481d
commit 7ebc12aaf7
2 changed files with 6 additions and 0 deletions

View File

@@ -84,6 +84,7 @@ bool WebServer::setupWebSocket(quint16 port){
connect(WSServer, SIGNAL(originAuthenticationRequired(QWebSocketCorsAuthenticator*)), this, SLOT(OriginAuthRequired(QWebSocketCorsAuthenticator*)) );
connect(WSServer, SIGNAL(peerVerifyError(const QSslError&)), this, SLOT(PeerVerifyError(const QSslError&)) );
connect(WSServer, SIGNAL(sslErrors(const QList<QSslError>&)), this, SLOT(SslErrors(const QList<QSslError>&)) );
connect(WSServer, SIGNAL(acceptError(QAbstractSocket::SocketError)), this, SLOT(ConnectError(QAbstractSocket::SocketError)) );
//Now start the server
return WSServer->listen(QHostAddress::Any, port);
}
@@ -153,6 +154,10 @@ void WebServer::OriginAuthRequired(QWebSocketCorsAuthenticator *auth){
}
void WebServer::ConnectError(QAbstractSocket::SocketError err){
qDebug() << "Connection Error" << err;
}
void WebServer::PeerVerifyError(const QSslError &err){
qDebug() << "Peer Verification Error:" << err.errorString();