increasing default rx tcp port (#562)

* increasing rx tcp port by default when creating shm
This commit is contained in:
Dhanya Thattil 2022-10-18 15:24:04 +02:00 committed by GitHub
parent d9e34e1657
commit d2c4827b31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 30 additions and 28 deletions

View File

@ -50,8 +50,8 @@ TEST_CASE("Set control port then create a new object with this control port",
Is this the best way to initialize the detectors
Using braces to make the object go out of scope
*/
int old_cport = DEFAULT_PORTNO;
int old_sport = DEFAULT_PORTNO + 1;
int old_cport = DEFAULT_TCP_CNTRL_PORTNO;
int old_sport = DEFAULT_TCP_STOP_PORTNO;
int new_cport = 1993;
int new_sport = 2000;
{
@ -79,7 +79,7 @@ TEST_CASE("Set control port then create a new object with this control port",
Module d(test::type);
d.setHostname(test::hostname);
CHECK(d.getStopPort() == DEFAULT_PORTNO + 1);
CHECK(d.getStopPort() == DEFAULT_TCP_STOP_PORTNO);
d.freeSharedMemory();
}

View File

@ -2,8 +2,9 @@
BIT32_MASK=0xFFFFFFFF
MAX_RX_DBIT=64
DEFAULT_PORTNO=1952
DEFAULT_UDP_PORTNO=50001
DEFAULT_TCP_CNTRL_PORTNO=1952
DEFAULT_TCP_STOP_PORTNO=1953
DEFAULT_TCP_RX_PORTNO=1954
DEFAULT_ZMQ_CL_PORTNO=30001
DEFAULT_ZMQ_RX_PORTNO=30001
DEFAULT_UDP_SRC_PORTNO=32410

View File

@ -11,7 +11,6 @@
#include <unistd.h>
#define SEND_REC_MAX_SIZE 4096
#define DEFAULT_PORTNO 1952
#define DEFAULT_BACKLOG 5
// blackfin limits

View File

@ -39,7 +39,7 @@ extern int masterCommandLine;
#ifdef EIGERD
extern int topCommandLine;
#endif
int portno = DEFAULT_PORTNO;
int portno = DEFAULT_TCP_CNTRL_PORTNO;
void error(char *msg) { perror(msg); }

View File

@ -281,7 +281,7 @@ void DetectorImpl::setHostname(const std::vector<std::string> &name) {
void DetectorImpl::addModule(const std::string &hostname) {
LOG(logINFO) << "Adding module " << hostname;
int port = DEFAULT_PORTNO;
int port = DEFAULT_TCP_CNTRL_PORTNO;
std::string host = hostname;
auto res = split(hostname, ':');
if (res.size() > 1) {

View File

@ -3195,11 +3195,11 @@ void Module::initializeModuleStructure(detectorType type) {
shm()->detType = type;
shm()->numberOfModule.x = 0;
shm()->numberOfModule.y = 0;
shm()->controlPort = DEFAULT_PORTNO;
shm()->stopPort = DEFAULT_PORTNO + 1;
shm()->controlPort = DEFAULT_TCP_CNTRL_PORTNO;
shm()->stopPort = DEFAULT_TCP_STOP_PORTNO;
strcpy_safe(shm()->settingsDir, getenv("HOME"));
strcpy_safe(shm()->rxHostname, "none");
shm()->rxTCPPort = DEFAULT_PORTNO + 2;
shm()->rxTCPPort = DEFAULT_TCP_RX_PORTNO + moduleIndex;
shm()->useReceiverFlag = false;
shm()->numUDPInterfaces = 1;
shm()->zmqport =

View File

@ -95,8 +95,9 @@ class Module : public virtual slsDetectorDefs {
int64_t getSerialNumber() const;
int getModuleId() const;
int64_t getReceiverSoftwareVersion() const;
static detectorType getTypeFromDetector(const std::string &hostname,
int cport = DEFAULT_PORTNO);
static detectorType
getTypeFromDetector(const std::string &hostname,
int cport = DEFAULT_TCP_CNTRL_PORTNO);
/** Get Detector type from shared memory */
detectorType getDetectorType() const;

View File

@ -43,7 +43,7 @@ ClientInterface::~ClientInterface() {
ClientInterface::ClientInterface(int portNumber)
: detType(GOTTHARD),
portNumber(portNumber > 0 ? portNumber : DEFAULT_PORTNO + 2),
portNumber(portNumber > 0 ? portNumber : DEFAULT_TCP_RX_PORTNO),
server(portNumber) {
functionTable();
parentThreadId = gettid();

View File

@ -329,7 +329,7 @@ class Implementation : private virtual slsDetectorDefs {
// network configuration (UDP)
std::array<std::string, MAX_NUMBER_OF_LISTENING_THREADS> eth;
std::array<uint32_t, MAX_NUMBER_OF_LISTENING_THREADS> udpPortNum{
{DEFAULT_UDP_PORTNO, DEFAULT_UDP_PORTNO + 1}};
{DEFAULT_UDP_DST_PORTNO, DEFAULT_UDP_DST_PORTNO + 1}};
int actualUDPSocketBufferSize{0};
// zmq parameters

View File

@ -35,8 +35,9 @@
#define MAX_RX_DBIT 64
/** default ports */
#define DEFAULT_PORTNO 1952
#define DEFAULT_UDP_PORTNO 50001
#define DEFAULT_TCP_CNTRL_PORTNO 1952
#define DEFAULT_TCP_STOP_PORTNO 1953
#define DEFAULT_TCP_RX_PORTNO 1954
#define DEFAULT_ZMQ_CL_PORTNO 30001
#define DEFAULT_ZMQ_RX_PORTNO 30001
#define DEFAULT_UDP_SRC_PORTNO 32410

View File

@ -5,10 +5,10 @@
#define APILIB 0x220609
#define APIRECEIVER 0x220609
#define APIGUI 0x220609
#define APIGOTTHARD 0x220916
#define APIGOTTHARD2 0x220916
#define APIMYTHEN3 0x220916
#define APIEIGER 0x220916
#define APICTB 0x220929
#define APIMOENCH 0x220929
#define APIJUNGFRAU 0x220929
#define APICTB 0x221004
#define APIGOTTHARD 0x221004
#define APIGOTTHARD2 0x221004
#define APIJUNGFRAU 0x221004
#define APIMYTHEN3 0x221004
#define APIMOENCH 0x221004
#define APIEIGER 0x221004