Pool Video Switch v2
Software video switch for distributed remote display in a lecture environment
Public Slots | Signals | Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
ServerConnection Class Reference

#include "serverconnection.h"

+ Inheritance diagram for ServerConnection:
+ Collaboration diagram for ServerConnection:

Public Slots

void onVncViewerStartStop (bool started, int clientId)
 This slot is triggered once the internal VNC viewer has started or stopped displaying a VNC stream. More...
 

Signals

void openVnc (const QString &host, int port, const QString &passwd, bool ro, bool fullscreen, const QString &caption, const int clientId, const QByteArray &rawThumb)
 
void closeVnc ()
 
void stateChange (ConnectWindow::ConnectionState state)
 
void disconnected (ServerConnection *connection)
 
void attentionChanged (bool state)
 

Public Member Functions

 ServerConnection (const QString &host, quint16 port, const QByteArray &sessionName, const QByteArray &certHash, bool autoConnect)
 
void disconnectFromServer ()
 Disconnect from current server. More...
 
 ~ServerConnection () override
 
bool isConnected () const
 
QString getPeerAdress () const
 
bool isLocalConnection ()
 
void sendMessage (NetworkMessage &message)
 Send the given message to the server. More...
 
void sendAttention (bool on)
 

Protected Member Functions

void timerEvent (QTimerEvent *event) override
 

Private Slots

void sslErrors (const QList< QSslError > &errors)
 An ssl error happened. More...
 
void sock_dataArrival ()
 
void sock_closed ()
 
void sock_error (QAbstractSocket::SocketError errcode)
 
void sock_connected ()
 
void onVncServerStartStop (int port, const QString &ropass, const QString &rwpass)
 This slot is triggered by the vnc server runner once the external VNC server was succesfully started, or was terminated (either planned or crashed). More...
 

Private Member Functions

void handleMsg ()
 Handles an incoming message by the server. More...
 
void checkLocalConnection ()
 

Private Attributes

QSslSocket * _socket
 
BlankScreen_blank
 
int _timerId
 
int _timerDelete
 
int _timerConnectionCheck
 
int _jpegQuality
 
int _authed
 
bool _autoConnect
 
int _isLocalConnection
 
qint64 _lastData
 
NetworkMessage _fromServer
 
NetworkMessage _toServer
 
QByteArray _expectedFingerprint
 
QString _passwd
 
QByteArray _myChallenge
 
QByteArray _sessionName
 
QByteArray _certHash
 

Detailed Description

Definition at line 10 of file serverconnection.h.

Constructor & Destructor Documentation

ServerConnection::ServerConnection ( const QString &  host,
quint16  port,
const QByteArray &  sessionName,
const QByteArray &  certHash,
bool  autoConnect 
)

Definition at line 20 of file serverconnection.cpp.

+ Here is the call graph for this function:

ServerConnection::~ServerConnection ( )
override

Definition at line 43 of file serverconnection.cpp.

+ Here is the call graph for this function:

Member Function Documentation

void ServerConnection::attentionChanged ( bool  state)
signal

+ Here is the caller graph for this function:

void ServerConnection::checkLocalConnection ( )
private

Definition at line 272 of file serverconnection.cpp.

+ Here is the caller graph for this function:

void ServerConnection::closeVnc ( )
signal

+ Here is the caller graph for this function:

void ServerConnection::disconnected ( ServerConnection connection)
signal

+ Here is the caller graph for this function:

void ServerConnection::disconnectFromServer ( )

Disconnect from current server.

Do some cleanup also, like stopping any VNC server/client activity, then finally close the connection.

Definition at line 81 of file serverconnection.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

QString ServerConnection::getPeerAdress ( ) const
inline

Definition at line 44 of file serverconnection.h.

+ Here is the caller graph for this function:

void ServerConnection::handleMsg ( )
private

Handles an incoming message by the server.

This is somewhat of a long mess, maybe split this up some day or make it OOP with a huge amount fancy features.

Definition at line 101 of file serverconnection.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ServerConnection::isConnected ( ) const
inline

Definition at line 39 of file serverconnection.h.

bool ServerConnection::isLocalConnection ( )
inline

Definition at line 46 of file serverconnection.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ServerConnection::onVncServerStartStop ( int  port,
const QString &  ropass,
const QString &  rwpass 
)
privateslot

This slot is triggered by the vnc server runner once the external VNC server was succesfully started, or was terminated (either planned or crashed).

Definition at line 325 of file serverconnection.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ServerConnection::onVncViewerStartStop ( bool  started,
int  clientId 
)
slot

This slot is triggered once the internal VNC viewer has started or stopped displaying a VNC stream.

We'll inform the server about the state change.

Definition at line 343 of file serverconnection.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ServerConnection::openVnc ( const QString &  host,
int  port,
const QString &  passwd,
bool  ro,
bool  fullscreen,
const QString &  caption,
const int  clientId,
const QByteArray &  rawThumb 
)
signal

+ Here is the caller graph for this function:

void ServerConnection::sendAttention ( bool  on)

Definition at line 68 of file serverconnection.cpp.

+ Here is the call graph for this function:

void ServerConnection::sendMessage ( NetworkMessage message)

Send the given message to the server.

Definition at line 58 of file serverconnection.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ServerConnection::sock_closed ( )
privateslot

Definition at line 401 of file serverconnection.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ServerConnection::sock_connected ( )
privateslot

Definition at line 415 of file serverconnection.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ServerConnection::sock_dataArrival ( )
privateslot

Definition at line 377 of file serverconnection.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ServerConnection::sock_error ( QAbstractSocket::SocketError  errcode)
privateslot

Definition at line 409 of file serverconnection.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ServerConnection::sslErrors ( const QList< QSslError > &  errors)
privateslot

An ssl error happened.

If it's an expected one, we ignore it and keep going. Otherwise the connection will be terminated.

Definition at line 359 of file serverconnection.cpp.

+ Here is the caller graph for this function:

void ServerConnection::stateChange ( ConnectWindow::ConnectionState  state)
signal

+ Here is the caller graph for this function:

void ServerConnection::timerEvent ( QTimerEvent *  event)
overrideprotected

Definition at line 288 of file serverconnection.cpp.

+ Here is the call graph for this function:

Member Data Documentation

int ServerConnection::_authed
private

Definition at line 19 of file serverconnection.h.

bool ServerConnection::_autoConnect
private

Definition at line 20 of file serverconnection.h.

BlankScreen* ServerConnection::_blank
private

Definition at line 16 of file serverconnection.h.

QByteArray ServerConnection::_certHash
private

Definition at line 29 of file serverconnection.h.

QByteArray ServerConnection::_expectedFingerprint
private

Definition at line 25 of file serverconnection.h.

NetworkMessage ServerConnection::_fromServer
private

Definition at line 24 of file serverconnection.h.

int ServerConnection::_isLocalConnection
private

Definition at line 21 of file serverconnection.h.

int ServerConnection::_jpegQuality
private

Definition at line 18 of file serverconnection.h.

qint64 ServerConnection::_lastData
private

Definition at line 22 of file serverconnection.h.

QByteArray ServerConnection::_myChallenge
private

Definition at line 27 of file serverconnection.h.

QString ServerConnection::_passwd
private

Definition at line 26 of file serverconnection.h.

QByteArray ServerConnection::_sessionName
private

Definition at line 28 of file serverconnection.h.

QSslSocket* ServerConnection::_socket
private

Definition at line 15 of file serverconnection.h.

int ServerConnection::_timerConnectionCheck
private

Definition at line 17 of file serverconnection.h.

int ServerConnection::_timerDelete
private

Definition at line 17 of file serverconnection.h.

int ServerConnection::_timerId
private

Definition at line 17 of file serverconnection.h.

NetworkMessage ServerConnection::_toServer
private

Definition at line 24 of file serverconnection.h.


The documentation for this class was generated from the following files: