#include <UdpMasterListener.h>
Signals | |
void | Listening () |
void | ClientAddressSet () |
Public Member Functions | |
UdpMasterListener (int server_port=gServerUdpPort) | |
virtual | ~UdpMasterListener () |
void | run () |
Implements the Thread Loop. To start the thread, call start() ( DO NOT CALL run() ). | |
void | stop () |
Stops the execution of the Thread. | |
int | releasePort (int id) |
Private Slots | |
void | testRecieve () |
Private Member Functions | |
void | sendToPoolPrototype (int id) |
int | isNewAddress (uint32_t address, uint16_t port) |
Check if address is already handled, if not add to array. | |
Static Private Member Functions | |
static void | bindUdpSocket (QUdpSocket &udpsocket, int port) |
Binds a QUdpSocket. It chooses the available (active) interface. | |
Private Attributes | |
QUdpSocket | mUdpMasterSocket |
The UDP socket. | |
QHostAddress | mPeerAddress |
The Peer Address. | |
JackTripWorker * | mJTWorker |
Class that will be used as prototype. | |
QThreadPool | mThreadPool |
The Thread Pool. | |
int | mServerPort |
int | mBasePort |
uint32_t | mActiveAddress [gMaxThreads][2] |
Active addresses pool numbers (32 bits IPv4 numbers). | |
QHash< uint32_t, uint16_t > | mActiveAddresPortPair |
volatile bool | mStopped |
Boolean stop the execution of the thread. | |
int | mTotalRunningThreads |
Number of Threads running in the pool. |
This creates a server that will listen on the well know port (the server port) and will spawn JackTrip threads into the Thread pool. Clients request a connection.
UdpMasterListener::UdpMasterListener | ( | int | server_port = gServerUdpPort |
) |
UdpMasterListener::~UdpMasterListener | ( | ) | [virtual] |
void UdpMasterListener::run | ( | ) |
void UdpMasterListener::stop | ( | ) | [inline] |
Stops the execution of the Thread.
int UdpMasterListener::releasePort | ( | int | id | ) |
void UdpMasterListener::testRecieve | ( | ) | [inline, private, slot] |
void UdpMasterListener::Listening | ( | ) | [signal] |
void UdpMasterListener::ClientAddressSet | ( | ) | [signal] |
void UdpMasterListener::bindUdpSocket | ( | QUdpSocket & | udpsocket, | |
int | port | |||
) | [static, private] |
Binds a QUdpSocket. It chooses the available (active) interface.
udpsocket | a QUdpSocket | |
port | Port number |
void UdpMasterListener::sendToPoolPrototype | ( | int | id | ) | [private] |
Check if address is already handled, if not add to array.
IPv4 | address as a number |
QUdpSocket UdpMasterListener::mUdpMasterSocket [private] |
The UDP socket.
QHostAddress UdpMasterListener::mPeerAddress [private] |
The Peer Address.
JackTripWorker* UdpMasterListener::mJTWorker [private] |
Class that will be used as prototype.
QThreadPool UdpMasterListener::mThreadPool [private] |
The Thread Pool.
int UdpMasterListener::mServerPort [private] |
int UdpMasterListener::mBasePort [private] |
uint32_t UdpMasterListener::mActiveAddress[gMaxThreads][2] [private] |
Active addresses pool numbers (32 bits IPv4 numbers).
QHash<uint32_t, uint16_t> UdpMasterListener::mActiveAddresPortPair [private] |
volatile bool UdpMasterListener::mStopped [private] |
Boolean stop the execution of the thread.
int UdpMasterListener::mTotalRunningThreads [private] |
Number of Threads running in the pool.