Commit 7933aa1b authored by jcacerec's avatar jcacerec
Browse files

Port number added as an option to udpprotocol

parent dd0d2c50
......@@ -52,18 +52,19 @@ using std::cout; using std::endl;
//*******************************************************************************
UdpDataProtocol::UdpDataProtocol(JackTrip* jacktrip, const runModeT runmode)
UdpDataProtocol::UdpDataProtocol(JackTrip* jacktrip, const runModeT runmode,
int incoming_port, int outgoing_port)
: DataProtocol(jacktrip, runmode), mRunMode(runmode),
mAudioPacket(NULL), mFullPacket(NULL)
{
// Base ports gInputPort_0 and gOutputPort_0 defined at globals.h
if (mRunMode == RECEIVER) {
mLocalPort = gInputPort_0;
mPeerPort = gOutputPort_0;
mLocalPort = incoming_port;
mPeerPort = outgoing_port;
}
else if (mRunMode == SENDER) {
mLocalPort = gOutputPort_0;
mPeerPort = gInputPort_0;
mLocalPort = outgoing_port;
mPeerPort = incoming_port;
}
// Bind Socket
......
......@@ -44,7 +44,7 @@
#include "DataProtocol.h"
#include "jacktrip_types.h"
#include "jacktrip_globals.h"
/** \brief UDP implementation of DataProtocol class
*/
......@@ -56,7 +56,8 @@ public:
* \param jacktrip Pointer to the JackTrip class that connects all classes (mediator)
* \param runmode Sets the run mode, use either SENDER or RECEIVER
*/
UdpDataProtocol(JackTrip* jacktrip, const runModeT runmode);
UdpDataProtocol(JackTrip* jacktrip, const runModeT runmode,
int incoming_port = gInputPort_0, int outgoing_port = gOutputPort_0);
/** \brief The class destructor
*/
......
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