diff --git a/integrationTests/test-integrationDectector.cpp b/integrationTests/test-integrationDectector.cpp index 977c66cdc..c02066513 100644 --- a/integrationTests/test-integrationDectector.cpp +++ b/integrationTests/test-integrationDectector.cpp @@ -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(); } diff --git a/python/slsdet/defines.py b/python/slsdet/defines.py index 4ca899196..4f86a03f3 100644 --- a/python/slsdet/defines.py +++ b/python/slsdet/defines.py @@ -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 diff --git a/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer b/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer index fbef895c2..5d42fa635 100755 Binary files a/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer and b/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer differ diff --git a/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_developer b/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_developer index 355fba9b5..6455efa82 100755 Binary files a/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_developer and b/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_developer differ diff --git a/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer b/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer index ce2832d91..10467ddf7 100755 Binary files a/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer and b/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer differ diff --git a/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer b/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer index d3f5995a6..b3a57dddc 100755 Binary files a/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer and b/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer differ diff --git a/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer b/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer index 0f4dc9d26..4d075725a 100755 Binary files a/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer and b/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer differ diff --git a/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer b/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer index ba35a7793..ab923eec2 100755 Binary files a/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer and b/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer differ diff --git a/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer b/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer index 93465c0c9..b8e8765a9 100755 Binary files a/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer and b/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer differ diff --git a/slsDetectorServers/slsDetectorServer/src/communication_funcs.c b/slsDetectorServers/slsDetectorServer/src/communication_funcs.c index 229670185..690eb0674 100644 --- a/slsDetectorServers/slsDetectorServer/src/communication_funcs.c +++ b/slsDetectorServers/slsDetectorServer/src/communication_funcs.c @@ -11,7 +11,6 @@ #include #define SEND_REC_MAX_SIZE 4096 -#define DEFAULT_PORTNO 1952 #define DEFAULT_BACKLOG 5 // blackfin limits diff --git a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer.c b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer.c index c60acd3a4..9ccbecc93 100644 --- a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer.c +++ b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer.c @@ -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); } diff --git a/slsDetectorSoftware/src/DetectorImpl.cpp b/slsDetectorSoftware/src/DetectorImpl.cpp index 8f49be089..7688d5708 100644 --- a/slsDetectorSoftware/src/DetectorImpl.cpp +++ b/slsDetectorSoftware/src/DetectorImpl.cpp @@ -281,7 +281,7 @@ void DetectorImpl::setHostname(const std::vector &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) { diff --git a/slsDetectorSoftware/src/Module.cpp b/slsDetectorSoftware/src/Module.cpp index a6da1f2de..856f4a07f 100644 --- a/slsDetectorSoftware/src/Module.cpp +++ b/slsDetectorSoftware/src/Module.cpp @@ -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 = diff --git a/slsDetectorSoftware/src/Module.h b/slsDetectorSoftware/src/Module.h index 0aea20ef7..ce6c89506 100644 --- a/slsDetectorSoftware/src/Module.h +++ b/slsDetectorSoftware/src/Module.h @@ -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; diff --git a/slsReceiverSoftware/src/ClientInterface.cpp b/slsReceiverSoftware/src/ClientInterface.cpp index ce881e449..72c1acf36 100644 --- a/slsReceiverSoftware/src/ClientInterface.cpp +++ b/slsReceiverSoftware/src/ClientInterface.cpp @@ -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(); diff --git a/slsReceiverSoftware/src/Implementation.h b/slsReceiverSoftware/src/Implementation.h index 59e5fd7b1..049b16670 100644 --- a/slsReceiverSoftware/src/Implementation.h +++ b/slsReceiverSoftware/src/Implementation.h @@ -329,7 +329,7 @@ class Implementation : private virtual slsDetectorDefs { // network configuration (UDP) std::array eth; std::array udpPortNum{ - {DEFAULT_UDP_PORTNO, DEFAULT_UDP_PORTNO + 1}}; + {DEFAULT_UDP_DST_PORTNO, DEFAULT_UDP_DST_PORTNO + 1}}; int actualUDPSocketBufferSize{0}; // zmq parameters diff --git a/slsSupportLib/include/sls/sls_detector_defs.h b/slsSupportLib/include/sls/sls_detector_defs.h index 021cefd96..df2fc3d8f 100644 --- a/slsSupportLib/include/sls/sls_detector_defs.h +++ b/slsSupportLib/include/sls/sls_detector_defs.h @@ -35,12 +35,13 @@ #define MAX_RX_DBIT 64 /** default ports */ -#define DEFAULT_PORTNO 1952 -#define DEFAULT_UDP_PORTNO 50001 -#define DEFAULT_ZMQ_CL_PORTNO 30001 -#define DEFAULT_ZMQ_RX_PORTNO 30001 -#define DEFAULT_UDP_SRC_PORTNO 32410 -#define DEFAULT_UDP_DST_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 +#define DEFAULT_UDP_DST_PORTNO 50001 #define MAX_UDP_DESTINATION 32 diff --git a/slsSupportLib/include/sls/versionAPI.h b/slsSupportLib/include/sls/versionAPI.h index 02248a210..1aea07bc5 100644 --- a/slsSupportLib/include/sls/versionAPI.h +++ b/slsSupportLib/include/sls/versionAPI.h @@ -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