Commit some more work converting the QTcpServer into an SslServer. The API test will now connect without failures - but it hangs there (no incoming messages detected)

This commit is contained in:
Ken Moore
2016-01-08 10:33:01 -05:00
parent 8abeeac890
commit fbbc72c3a4
4 changed files with 69 additions and 5 deletions

View File

@@ -87,7 +87,12 @@ bool WebServer::setupWebSocket(quint16 port){
}
bool WebServer::setupTcp(quint16 port){
TCPServer = new QTcpServer(this);
if(!QSslSocket::supportsSsl()){ qDebug() << "No SSL Support on this system!!!"; return false; }
else{
qDebug() << "Using SSL Library:";
qDebug() << " - Version:" << QSslSocket::sslLibraryVersionString();
}
TCPServer = new SslServer(this);
//Setup Connections
connect(TCPServer, SIGNAL(newConnection()), this, SLOT(NewSocketConnection()) );
connect(TCPServer, SIGNAL(acceptError(QAbstractSocket::SocketError)), this, SLOT(NewConnectError(QAbstractSocket::SocketError)) );
@@ -123,7 +128,7 @@ void WebServer::NewSocketConnection(){
if(WSServer!=0){
if(WSServer->hasPendingConnections()){ sock = new WebSocket( WSServer->nextPendingConnection(), generateID(), AUTH); }
}else if(TCPServer!=0){
if(TCPServer->hasPendingConnections()){ sock = new WebSocket( static_cast<QSslSocket*>(TCPServer->nextPendingConnection()), generateID(), AUTH); }
if(TCPServer->hasPendingConnections()){ sock = new WebSocket( TCPServer->nextPendingConnection(), generateID(), AUTH); }
}
if(sock==0){ return; } //no new connection
qDebug() << "New Socket Connection";