38 #ifndef __UDPHUBLISTENER_H__
39 #define __UDPHUBLISTENER_H__
46 #include <QThreadPool>
48 #include <QHostAddress>
81 void stop() { mStopped =
true; }
88 { std::cout << std::endl <<
"Shutting Down..." << std::endl; sSigInt =
true; }
92 { std::cout <<
"========= TEST RECEIVE SLOT ===========" << std::endl; }
93 void receivedNewConnection();
108 void receivedClientInfo(QTcpSocket *clientConnection);
110 static void bindUdpSocket(QUdpSocket& udpsocket,
int port);
112 uint16_t readClientUdpPort(QTcpSocket* clientConnection, QString &clientName);
113 int sendUdpPort(QTcpSocket* clientConnection,
int udp_port);
126 int isNewAddress(QString address,
uint16_t port);
131 int getPoolID(QString address,
uint16_t port);
133 void stopAllThreads();
139 QVector<JackTripWorker*>* mJTWorkers;
140 QThreadPool mThreadPool;
142 QTcpServer mTcpServer;
147 QHash<QString, uint16_t> mActiveAddressPortPair;
150 volatile bool mStopped;
152 QTimer mStopCheckTimer;
153 int mTotalRunningThreads;
156 int mBufferQueueLength;
158 QStringList mHubPatchDescriptions;
159 bool m_connectDefaultAudioPorts;
162 QSharedPointer<std::ofstream> mIOStatStream;
166 double mSimulatedLossRate;
167 double mSimulatedJitterRate;
168 double mSimulatedDelayRel;
169 bool mUseRtUdpPriority;
173 void connectMesh(
bool spawn);
174 void enumerateRunningThreadIDs();
176 void setWAIR(
int b) {mWAIR = b;}
177 bool isWAIR() {
return mWAIR;}
179 void connectPatch(
bool spawn);
189 void setIOStatStream(QSharedPointer<std::ofstream> statStream) { mIOStatStream = statStream; }
194 mSimulatedLossRate = loss;
195 mSimulatedJitterRate = jitter;
196 mSimulatedDelayRel = delay_rel;
198 void setBroadcast(
int broadcast_queue) {mBroadcastQueue = broadcast_queue;}
underrunModeT
Enum for the JackTrip Underrun Mode, when packets.
Definition: JackTrip.h:94
Prototype of the worker class that will be cloned through sending threads to the Thread Pool.
Definition: JackTripWorker.h:68
Class to set usage options and parse settings from input.
Definition: Settings.h:61
Hub UDP listener on the Server.
Definition: UdpHubListener.h:70
void setBufferStrategy(int BufferStrategy)
Definition: UdpHubListener.h:191
void setUseRtUdpPriority(bool use)
Definition: UdpHubListener.h:199
int releaseThread(int id)
Definition: UdpHubListener.cpp:472
void start()
Starts the TCP server.
Definition: UdpHubListener.cpp:135
UdpHubListener(int server_port=gServerUdpPort, int server_udp_port=0)
Definition: UdpHubListener.cpp:57
void setBroadcast(int broadcast_queue)
Definition: UdpHubListener.h:198
void setNetIssuesSimulation(double loss, double jitter, double delay_rel)
Definition: UdpHubListener.h:192
unsigned int getHubPatch()
Definition: UdpHubListener.h:183
void Listening()
Definition: moc_UdpHubListener.cpp:193
void setIOStatTimeout(int timeout)
Definition: UdpHubListener.h:188
void signalStopped()
Definition: moc_UdpHubListener.cpp:212
virtual ~UdpHubListener()
Definition: UdpHubListener.cpp:118
void setBufferQueueLength(int BufferQueueLength)
Definition: UdpHubListener.h:186
void setHubPatch(unsigned int p)
Definition: UdpHubListener.h:182
void setIOStatStream(QSharedPointer< std::ofstream > statStream)
Definition: UdpHubListener.h:189
static void sigIntHandler(__attribute__((unused)) int unused)
Definition: UdpHubListener.h:87
void ClientAddressSet()
Definition: moc_UdpHubListener.cpp:199
void signalError(const QString &errorMessage)
Definition: moc_UdpHubListener.cpp:218
void stop()
Stops the execution of the Thread.
Definition: UdpHubListener.h:81
void signalRemoveThread(int id)
Definition: moc_UdpHubListener.cpp:205
void setUnderRunMode(JackTrip::underrunModeT UnderRunMode)
Definition: UdpHubListener.h:185
void setConnectDefaultAudioPorts(bool connectDefaultAudioPorts)
Definition: UdpHubListener.h:85
unsigned int mHubPatch
Definition: UdpHubListener.h:181
const int gMaxThreads
Maximum Threads that can be run at the same time.
Definition: jacktrip_globals.h:143
const int gServerUdpPort
Public well-known UDP port to where the clients will connect.
Definition: jacktrip_globals.h:146
qint16 int16_t
Typedef for signed short. This type is guaranteed to be 16-bit.
Definition: jacktrip_types.h:80
quint16 uint16_t
Typedef for unsigned short. This type is guaranteed to be 16-bit.
Definition: jacktrip_types.h:71
Definition: UdpHubListener.h:59
QString address
Definition: UdpHubListener.h:60
int16_t port
Definition: UdpHubListener.h:61