Unverified Commit e1b357e7 authored by Aaron Wyatt's avatar Aaron Wyatt Committed by GitHub
Browse files

Add files via upload

Added cchafe's fixes to hubpatch mode 2 from main branch.
Some minor cleanup to the UdpDataProtocol code and comments.
parent b6bbebc9
......@@ -230,26 +230,29 @@ void JMess::connectSpawnedPorts(int nChans, int hubPatch)
}
}
// implements FULLMIX part which is CLIENTFOFI
for (int i = 0; i<ctr; i++) {
if (hubPatch == JackTrip::FULLMIX) jLimit = (ctr-1);
for (int j = 0; j<jLimit; j++) {
if (hubPatch == JackTrip::CLIENTECHO) k = i;
else if (hubPatch == JackTrip::FULLMIX) k = (j+(i+1))%ctr;
for (int l = 1; l<=nChans; l++) { // chans are 1-based
qDebug() << "connect " << IPS[i]+":receive_"+QString::number(l)
<<"with " << IPS[k]+":send_"+QString::number(l);
QString left = IPS[i] +
":receive_" + QString::number(l);
QString right = IPS[k] +
":send_" + QString::number(l);
if (0 !=
jack_connect(mClient, left.toStdString().c_str(), right.toStdString().c_str())) {
qDebug() << "WARNING: port: " << left
<< "and port: " << right
<< " could not be connected.";
// do it again to implement the FULLMIX part which is CLIENTFOFI
if (hubPatch == JackTrip::FULLMIX) {
jLimit = (ctr-1); // same as CLIENTFOFI
/*************/
// todo: the next block should be in a method, it's a repeat of the above
for (int i = 0; i<ctr; i++) {
for (int j = 0; j<jLimit; j++) {
k = (j+(i+1))%ctr;
for (int l = 1; l<=nChans; l++) { // chans are 1-based
qDebug() << "connect " << IPS[i]+":receive_"+QString::number(l)
<<"with " << IPS[k]+":send_"+QString::number(l);
QString left = IPS[i] +
":receive_" + QString::number(l);
QString right = IPS[k] +
":send_" + QString::number(l);
if (0 !=
jack_connect(mClient, left.toStdString().c_str(), right.toStdString().c_str())) {
qDebug() << "WARNING: port: " << left
<< "and port: " << right
<< " could not be connected.";
}
}
}
}
......@@ -470,3 +473,4 @@ void JMess::connectPorts(QString xmlInFile)
// }
}
......@@ -78,7 +78,9 @@ UdpDataProtocol::UdpDataProtocol(JackTrip* jacktrip, const runModeT runmode,
mIPv6 = false;
std::memset(&mPeerAddr, 0, sizeof(mPeerAddr));
std::memset(&mPeerAddr6, 0, sizeof(mPeerAddr6));
mPeerAddr.sin_family = AF_INET;
mPeerAddr.sin_port = htons(mPeerPort);
mPeerAddr6.sin6_family = AF_INET6;
mPeerAddr6.sin6_port = htons(mPeerPort);
if (mRunMode == RECEIVER) {
......@@ -131,13 +133,11 @@ void UdpDataProtocol::setPeerAddress(const char* peerHostOrIP) throw(std::invali
}
*/
// Save our address as an appropriate address structure
// Save our address to the appropriate address structure
if (mIPv6) {
mPeerAddr6.sin6_family = AF_INET6;
::inet_pton(AF_INET6, mPeerAddress.toString().toLatin1().constData(),
&mPeerAddr6.sin6_addr);
} else {
mPeerAddr.sin_family = AF_INET;
::inet_pton(AF_INET, mPeerAddress.toString().toLatin1().constData(),
&mPeerAddr.sin_addr);
}
......
......@@ -201,13 +201,11 @@ private:
bool mIPv6; /// Use IPv6
QHostAddress mPeerAddress; ///< The Peer Address
struct sockaddr_in mPeerAddr;
struct sockaddr_in6 mPeerAddr6;
#if defined (__WIN_32__)
SOCKADDR_IN mPeerAddr;
SOCKADDR_IN6 mPeerAddr6;
SOCKET mSocket;
#else
struct sockaddr_in mPeerAddr;
struct sockaddr_in6 mPeerAddr6;
int mSocket;
#endif
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment