From 494727e1e5f0e459153e8845168545ad4a72e598 Mon Sep 17 00:00:00 2001 From: Björn Hagemeister Date: Mon, 26 May 2014 18:34:36 +0200 Subject: Several changes: Fixed segmentaion fault, which occured after streaming to all clients. Added sessionName as command line argument to client, so that it connects immediatly after running to given sessionName. If pvsclient shows connected status also display IP-Adress of the running pvsmanager. --- src/server/mainwindow/mainwindow.cpp | 19 ++++++++++++++++--- src/server/net/listenserver.cpp | 1 + src/server/net/sslserver.cpp | 1 + 3 files changed, 18 insertions(+), 3 deletions(-) (limited to 'src/server') diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp index 1efc87a..26508d2 100644 --- a/src/server/mainwindow/mainwindow.cpp +++ b/src/server/mainwindow/mainwindow.cpp @@ -56,6 +56,7 @@ MainWindow::MainWindow(QString ipListUrl, QWidget* parent) : _tutorFrame = NULL; _selectedFrame = NULL; + _streamingSource = NULL; _sessionNameWindow = new SessionNameWindow(this); _helpWindow = new HelpWindow(this); @@ -703,11 +704,17 @@ void MainWindow::onClientConnected(Client* client) /***************************************************************************//** * Authenticate new Client client. + * Check if incoming client ip already exists, + * if yes --> return. + * Check if same name of client already exist, + * if yes --> name new client as name(x). + * x = number of clients with the same name. * @param client * @param request */ void MainWindow::onClientAuthenticating(Client* client, ClientLogin* request) { + qDebug("onClientAuthenticating - Slot was called."); disconnect(client, SIGNAL(authenticating(Client*, ClientLogin*)), this, SLOT(onClientAuthenticating(Client*, ClientLogin*))); if (!request->accept) // Another receiver of that signal already rejected the client, so nothing to do return; @@ -744,12 +751,18 @@ void MainWindow::onClientAuthenticating(Client* client, ClientLogin* request) } /***************************************************************************//** - * After authenticating new client, check if that's the first one and set tutor if necessary. - * Also check the current VNC status and take these setting also for the new client. + * New client was authenticated, make several checks. + * Check if new clients ip already exists, + * if yes --> not necessary to create new clientFrame. + * if not --> create a new one and adapt this one to current + * situation in class room(projection / lock screen). + * Check if avctiv tutor is available, + * if not --> check if new client is possible tutor. * @param client */ void MainWindow::onClientAuthenticated(Client* client) { + qDebug("Entering onClientAuthenticated - Slot."); disconnect(client, SIGNAL(authenticated(Client*)), this, SLOT(onClientAuthenticated(Client*))); connect(client, SIGNAL(vncServerStateChange(Client*)), this, SLOT(onVncServerStateChange(Client*)), Qt::QueuedConnection); connect(client, SIGNAL(vncClientStateChange(Client*, int)), this, SLOT(onVncClientStateChange(Client*, int)), Qt::QueuedConnection); @@ -779,7 +792,7 @@ void MainWindow::onClientAuthenticated(Client* client) } } } - + // Clients ip already exists, but was not active. if (existing != NULL) { existing->setTutor(isTutor); diff --git a/src/server/net/listenserver.cpp b/src/server/net/listenserver.cpp index 8eb3750..859ee33 100644 --- a/src/server/net/listenserver.cpp +++ b/src/server/net/listenserver.cpp @@ -32,6 +32,7 @@ ListenServer::~ListenServer() */ void ListenServer::newClientConnection() { + qDebug("Listenserver::newClientConnection()."); QSslSocket* sock; while ((sock = (QSslSocket*)_server.nextPendingConnection()) != NULL) { diff --git a/src/server/net/sslserver.cpp b/src/server/net/sslserver.cpp index 4ea3991..65a40b4 100644 --- a/src/server/net/sslserver.cpp +++ b/src/server/net/sslserver.cpp @@ -36,6 +36,7 @@ SslServer::~SslServer() */ void SslServer::incomingConnection(int socketDescriptor) { + qDebug("SslServer:incomingConnection."); QSslSocket *serverSocket = new QSslSocket(NULL); connect(serverSocket, SIGNAL(sslErrors(const QList &)), this, SLOT(sslErrors(const QList &))); QSslKey key; -- cgit v1.2.3-55-g7522