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

#include "serverdiscovery.h"

+ Inheritance diagram for ServerDiscovery:
+ Collaboration diagram for ServerDiscovery:

Public Types

enum  ErrorType { ErrorType::InvalidIpList, ErrorType::InvalidHash }
 

Signals

void serverDetected (const QString &host, const quint16 port, const QByteArray &sessionName, const QByteArray &certHash, bool autoConnect)
 
void error (ErrorType e, int count)
 

Public Member Functions

 ServerDiscovery (QObject *parent=nullptr)
 Ctor. More...
 
 ~ServerDiscovery () override
 Dtor. More...
 
void start (const QByteArray &sessionName, const QString &mgrIP)
 start More...
 
void stop ()
 stop More...
 
bool isActive ()
 

Private Slots

void doDiscovery ()
 ConnectWindow::doDiscovery. More...
 
void onUdpReadyRead ()
 Handle incoming service discovery packets. More...
 

Private Attributes

QTimer _discoveryTimer
 
const int _minDiscoveryInterval
 
const int _maxDiscoveryInterval
 
int _hashErrorCount
 
int _ipErrorCount
 
QByteArray _nameBytes
 
QByteArray _salt2
 
QUdpSocket _discoverySocket
 
NetworkMessage _packet
 
QHostAddress _mgrIP
 

Static Private Attributes

static const int UDPBUFSIZ = 9000
 
static const int SALT_LEN = 18
 

Detailed Description

Definition at line 9 of file serverdiscovery.h.

Member Enumeration Documentation

Enumerator
InvalidIpList 
InvalidHash 

Definition at line 14 of file serverdiscovery.h.

Constructor & Destructor Documentation

ServerDiscovery::ServerDiscovery ( QObject parent = nullptr)
explicit

Ctor.

Definition at line 12 of file serverdiscovery.cpp.

+ Here is the call graph for this function:

ServerDiscovery::~ServerDiscovery ( )
overridedefault

Dtor.

Member Function Documentation

void ServerDiscovery::doDiscovery ( )
privateslot

ConnectWindow::doDiscovery.

Definition at line 88 of file serverdiscovery.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ServerDiscovery::error ( ErrorType  e,
int  count 
)
signal

+ Here is the caller graph for this function:

bool ServerDiscovery::isActive ( )
inline

Definition at line 25 of file serverdiscovery.h.

+ Here is the caller graph for this function:

void ServerDiscovery::onUdpReadyRead ( )
privateslot

Handle incoming service discovery packets.

Definition at line 137 of file serverdiscovery.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ServerDiscovery::serverDetected ( const QString &  host,
const quint16  port,
const QByteArray &  sessionName,
const QByteArray &  certHash,
bool  autoConnect 
)
signal

+ Here is the caller graph for this function:

void ServerDiscovery::start ( const QByteArray &  sessionName,
const QString &  mgrIP 
)

start

Definition at line 47 of file serverdiscovery.cpp.

+ Here is the caller graph for this function:

void ServerDiscovery::stop ( )

stop

Definition at line 74 of file serverdiscovery.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

QUdpSocket ServerDiscovery::_discoverySocket
private

Definition at line 35 of file serverdiscovery.h.

QTimer ServerDiscovery::_discoveryTimer
private

Definition at line 28 of file serverdiscovery.h.

int ServerDiscovery::_hashErrorCount
private

Definition at line 31 of file serverdiscovery.h.

int ServerDiscovery::_ipErrorCount
private

Definition at line 32 of file serverdiscovery.h.

const int ServerDiscovery::_maxDiscoveryInterval
private

Definition at line 30 of file serverdiscovery.h.

QHostAddress ServerDiscovery::_mgrIP
private

Definition at line 38 of file serverdiscovery.h.

const int ServerDiscovery::_minDiscoveryInterval
private

Definition at line 29 of file serverdiscovery.h.

QByteArray ServerDiscovery::_nameBytes
private

Definition at line 33 of file serverdiscovery.h.

NetworkMessage ServerDiscovery::_packet
private

Definition at line 36 of file serverdiscovery.h.

QByteArray ServerDiscovery::_salt2
private

Definition at line 34 of file serverdiscovery.h.

const int ServerDiscovery::SALT_LEN = 18
staticprivate

Definition at line 41 of file serverdiscovery.h.

const int ServerDiscovery::UDPBUFSIZ = 9000
staticprivate

Definition at line 40 of file serverdiscovery.h.


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