mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-24 15:20:02 +02:00
Exception handling from constructors for slsDetector and multiSlsDetector, zmqsockets deleted first in multi freeshm/constructor, removed unnecessary exceptions from exceptions list, replaced in slsDetector socket assign from NULL to 0
This commit is contained in:
parent
39ebd81230
commit
da4253fe13
@ -23,8 +23,7 @@ using namespace std;
|
|||||||
int main(int argc, char *argv[]){
|
int main(int argc, char *argv[]){
|
||||||
qClient* cl = 0;
|
qClient* cl = 0;
|
||||||
try {
|
try {
|
||||||
qClient *c = new qClient(argv[1]);
|
cl = new qClient(argv[1]);
|
||||||
cl = c;
|
|
||||||
} catch(...) {
|
} catch(...) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -42,14 +41,11 @@ qClient::qClient(char* hostname):
|
|||||||
mySocket(0),
|
mySocket(0),
|
||||||
myStopSocket(0){
|
myStopSocket(0){
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// control socket
|
// control socket
|
||||||
MySocketTCP* s = new MySocketTCP(hostname, DEFAULT_GUI_PORTNO);
|
mySocket = new MySocketTCP(hostname, DEFAULT_GUI_PORTNO);
|
||||||
mySocket = s;
|
|
||||||
// stop socket
|
// stop socket
|
||||||
s = new MySocketTCP(hostname, DEFAULT_GUI_PORTNO+1);
|
myStopSocket = new MySocketTCP(hostname, DEFAULT_GUI_PORTNO+1);
|
||||||
myStopSocket = s;
|
|
||||||
} catch(...) {
|
} catch(...) {
|
||||||
if (mySocket == 0)
|
if (mySocket == 0)
|
||||||
cout << "Error: could not connect to control server:" <<
|
cout << "Error: could not connect to control server:" <<
|
||||||
|
@ -42,6 +42,7 @@ multiSlsDetector::multiSlsDetector(int id, bool verify, bool update)
|
|||||||
|
|
||||||
|
|
||||||
multiSlsDetector::~multiSlsDetector() {
|
multiSlsDetector::~multiSlsDetector() {
|
||||||
|
// delete zmq sockets first
|
||||||
for (vector<ZmqSocket*>::const_iterator it = zmqSocket.begin(); it != zmqSocket.end(); ++it) {
|
for (vector<ZmqSocket*>::const_iterator it = zmqSocket.begin(); it != zmqSocket.end(); ++it) {
|
||||||
delete(*it);
|
delete(*it);
|
||||||
}
|
}
|
||||||
@ -641,6 +642,12 @@ void multiSlsDetector::freeSharedMemory(int multiId) {
|
|||||||
|
|
||||||
|
|
||||||
void multiSlsDetector::freeSharedMemory() {
|
void multiSlsDetector::freeSharedMemory() {
|
||||||
|
// clear zmq vector
|
||||||
|
for (vector<ZmqSocket*>::const_iterator it = zmqSocket.begin(); it != zmqSocket.end(); ++it) {
|
||||||
|
delete(*it);
|
||||||
|
}
|
||||||
|
zmqSocket.clear();
|
||||||
|
|
||||||
// should be done before the detector list is deleted
|
// should be done before the detector list is deleted
|
||||||
clearAllErrorMask();
|
clearAllErrorMask();
|
||||||
|
|
||||||
@ -653,18 +660,14 @@ void multiSlsDetector::freeSharedMemory() {
|
|||||||
|
|
||||||
// clear multi detector shm
|
// clear multi detector shm
|
||||||
if (sharedMemory) {
|
if (sharedMemory) {
|
||||||
sharedMemory->UnmapSharedMemory(thisMultiDetector);
|
if (thisMultiDetector) {
|
||||||
|
sharedMemory->UnmapSharedMemory(thisMultiDetector);
|
||||||
|
thisMultiDetector = 0;
|
||||||
|
}
|
||||||
sharedMemory->RemoveSharedMemory();
|
sharedMemory->RemoveSharedMemory();
|
||||||
delete sharedMemory;
|
delete sharedMemory;
|
||||||
sharedMemory = 0;
|
sharedMemory = 0;
|
||||||
}
|
}
|
||||||
thisMultiDetector = 0;
|
|
||||||
|
|
||||||
// clear zmq vector
|
|
||||||
for (vector<ZmqSocket*>::const_iterator it = zmqSocket.begin(); it != zmqSocket.end(); ++it) {
|
|
||||||
delete(*it);
|
|
||||||
}
|
|
||||||
zmqSocket.clear();
|
|
||||||
|
|
||||||
// zmq
|
// zmq
|
||||||
destroyThreadPool();
|
destroyThreadPool();
|
||||||
@ -696,47 +699,46 @@ std::string multiSlsDetector::getUserDetails() {
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* pre: sharedMemory=0, thisMultiDetector = 0, detectors.size() = 0
|
||||||
|
* exceptions are caught in calling function, shm unmapped and deleted
|
||||||
|
*/
|
||||||
bool multiSlsDetector::initSharedMemory(bool verify) {
|
bool multiSlsDetector::initSharedMemory(bool verify) {
|
||||||
|
|
||||||
// clear
|
|
||||||
if (sharedMemory) {
|
|
||||||
delete sharedMemory;
|
|
||||||
}
|
|
||||||
thisMultiDetector = 0;
|
|
||||||
|
|
||||||
for (vector<slsDetector*>::const_iterator it = detectors.begin(); it != detectors.end(); ++it) {
|
|
||||||
delete(*it);
|
|
||||||
}
|
|
||||||
detectors.clear();
|
|
||||||
|
|
||||||
// create/open shm and map to structure
|
|
||||||
size_t sz = sizeof(sharedMultiSlsDetector);
|
size_t sz = sizeof(sharedMultiSlsDetector);
|
||||||
|
|
||||||
bool created = false;
|
bool created = false;
|
||||||
sharedMemory = new SharedMemory(detId, -1);
|
|
||||||
if (sharedMemory->IsExisting()) {
|
try {
|
||||||
thisMultiDetector = (sharedMultiSlsDetector*)sharedMemory->OpenSharedMemory(sz);
|
// shared memory object with name
|
||||||
if (verify && thisMultiDetector->shmversion != MULTI_SHMVERSION) {
|
sharedMemory = new SharedMemory(detId, -1);
|
||||||
cprintf(RED, "Multi shared memory (%d) version mismatch "
|
|
||||||
"(expected 0x%x but got 0x%x)\n", detId,
|
//create
|
||||||
MULTI_SHMVERSION, thisMultiDetector->shmversion);
|
if (!sharedMemory->IsExisting()) {
|
||||||
sharedMemory->UnmapSharedMemory(thisMultiDetector);
|
|
||||||
delete sharedMemory;
|
|
||||||
sharedMemory = 0;
|
|
||||||
throw SharedMemoryException();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
thisMultiDetector = (sharedMultiSlsDetector*)sharedMemory->CreateSharedMemory(sz);
|
thisMultiDetector = (sharedMultiSlsDetector*)sharedMemory->CreateSharedMemory(sz);
|
||||||
created = true;
|
created = true;
|
||||||
} catch(...) {
|
}
|
||||||
sharedMemory->RemoveSharedMemory();
|
// open and verify version
|
||||||
|
else {
|
||||||
|
thisMultiDetector = (sharedMultiSlsDetector*)sharedMemory->OpenSharedMemory(sz);
|
||||||
|
if (verify && thisMultiDetector->shmversion != MULTI_SHMVERSION) {
|
||||||
|
cprintf(RED, "Multi shared memory (%d) version mismatch "
|
||||||
|
"(expected 0x%x but got 0x%x)\n", detId,
|
||||||
|
MULTI_SHMVERSION, thisMultiDetector->shmversion);
|
||||||
|
throw SharedMemoryException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (...) {
|
||||||
|
if (sharedMemory) {
|
||||||
|
// unmap
|
||||||
|
if (thisMultiDetector) {
|
||||||
|
sharedMemory->UnmapSharedMemory(thisMultiDetector);
|
||||||
|
thisMultiDetector = 0;
|
||||||
|
}
|
||||||
|
// delete
|
||||||
delete sharedMemory;
|
delete sharedMemory;
|
||||||
sharedMemory = 0;
|
sharedMemory = 0;
|
||||||
thisMultiDetector = 0;
|
|
||||||
throw;
|
|
||||||
}
|
}
|
||||||
|
throw;
|
||||||
}
|
}
|
||||||
|
|
||||||
return created;
|
return created;
|
||||||
@ -881,8 +883,17 @@ void multiSlsDetector::initializeMembers(bool verify) {
|
|||||||
|
|
||||||
// get objects from single det shared memory (open)
|
// get objects from single det shared memory (open)
|
||||||
for (int i = 0; i < thisMultiDetector->numberOfDetectors; i++) {
|
for (int i = 0; i < thisMultiDetector->numberOfDetectors; i++) {
|
||||||
slsDetector* sdet = new slsDetector(detId, i, verify, this);
|
try {
|
||||||
detectors.push_back(sdet);
|
slsDetector* sdet = new slsDetector(detId, i, verify, this);
|
||||||
|
detectors.push_back(sdet);
|
||||||
|
} catch (...) {
|
||||||
|
// clear detectors list
|
||||||
|
for (vector<slsDetector*>::const_iterator it = detectors.begin(); it != detectors.end(); ++it) {
|
||||||
|
delete(*it);
|
||||||
|
}
|
||||||
|
detectors.clear();
|
||||||
|
throw;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// depend on number of detectors
|
// depend on number of detectors
|
||||||
|
@ -115,8 +115,8 @@ public:
|
|||||||
try { \
|
try { \
|
||||||
multiSlsDetector* m = new multiSlsDetector(id, verify, update); \
|
multiSlsDetector* m = new multiSlsDetector(id, verify, update); \
|
||||||
myDetector = m; \
|
myDetector = m; \
|
||||||
} catch (const SharedMemoryException & e) { \
|
} catch (const SlsDetectorPackageExceptions & e) { \
|
||||||
cout << e.GetMessage() << endl; \
|
/*cout << e.GetMessage() << endl;*/ \
|
||||||
return; \
|
return; \
|
||||||
} catch (...) { \
|
} catch (...) { \
|
||||||
cout << " caught exception" << endl; \
|
cout << " caught exception" << endl; \
|
||||||
@ -129,8 +129,8 @@ public:
|
|||||||
myCmd=new multiSlsDetectorCommand(myDetector); \
|
myCmd=new multiSlsDetectorCommand(myDetector); \
|
||||||
try { \
|
try { \
|
||||||
answer=myCmd->executeLine(argc, argv, action, pos); \
|
answer=myCmd->executeLine(argc, argv, action, pos); \
|
||||||
} catch (const SharedMemoryException & e) { \
|
} catch (const SlsDetectorPackageExceptions & e) { \
|
||||||
cout << e.GetMessage() << endl; \
|
/*cout << e.GetMessage() << endl; */ \
|
||||||
delete myCmd; \
|
delete myCmd; \
|
||||||
if (del) delete myDetector; \
|
if (del) delete myDetector; \
|
||||||
return; \
|
return; \
|
||||||
|
@ -61,6 +61,7 @@ void* SharedMemory::CreateSharedMemory(size_t sz){
|
|||||||
cprintf(RED, "Error: Create shared memory %s failed at ftruncate: %s\n",
|
cprintf(RED, "Error: Create shared memory %s failed at ftruncate: %s\n",
|
||||||
name.c_str(), strerror(errno));
|
name.c_str(), strerror(errno));
|
||||||
close(fd);
|
close(fd);
|
||||||
|
RemoveSharedMemory();
|
||||||
throw SharedMemoryException();
|
throw SharedMemoryException();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,8 +138,10 @@ std::string SharedMemory::ConstructSharedMemoryName(int multiId, int slsId) {
|
|||||||
|
|
||||||
std::string temp = ss.str();
|
std::string temp = ss.str();
|
||||||
if (temp.length() > NAME_MAX) {
|
if (temp.length() > NAME_MAX) {
|
||||||
cprintf(RED, "Error: Shared memory initialization %s failed: %s\n",
|
cprintf(RED, "Error: Shared memory initialization failed. "
|
||||||
name.c_str(), strerror(errno));
|
"%s has %lu characters. \n"
|
||||||
|
"Maximum is %d. Change the environment variable %s\n",
|
||||||
|
temp.c_str(), temp.length(), NAME_MAX, SHM_ENV_NAME);
|
||||||
throw SharedMemoryException();
|
throw SharedMemoryException();
|
||||||
}
|
}
|
||||||
return temp;
|
return temp;
|
||||||
|
@ -91,8 +91,7 @@ int main(int argc, char* argv[])
|
|||||||
MySocketTCP* mySocket = 0;
|
MySocketTCP* mySocket = 0;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
MySocketTCP* s = new MySocketTCP(argv[1],1952);
|
mySocket = new MySocketTCP(argv[1],1952);
|
||||||
mySocket = s;
|
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
cerr << "could not create socket with " << argv[1] << endl;
|
cerr << "could not create socket with " << argv[1] << endl;
|
||||||
help();
|
help();
|
||||||
|
@ -53,7 +53,6 @@ slsDetector::slsDetector(detectorType type, int multiId, int id, bool verify, mu
|
|||||||
}
|
}
|
||||||
delete shm;
|
delete shm;
|
||||||
|
|
||||||
|
|
||||||
initSharedMemory(true, type, multiId, verify);
|
initSharedMemory(true, type, multiId, verify);
|
||||||
initializeDetectorStructure(type);
|
initializeDetectorStructure(type);
|
||||||
initializeMembers();
|
initializeMembers();
|
||||||
@ -81,8 +80,10 @@ slsDetector::slsDetector(int multiId, int id, bool verify, multiSlsDetector* m)
|
|||||||
offset(0) {
|
offset(0) {
|
||||||
/* called from multi constructor to populate structure,
|
/* called from multi constructor to populate structure,
|
||||||
* so sls shared memory will be opened, not created */
|
* so sls shared memory will be opened, not created */
|
||||||
|
|
||||||
// getDetectorType Froom shm will check if it was already existing
|
// getDetectorType Froom shm will check if it was already existing
|
||||||
detectorType type = getDetectorTypeFromShm(multiId, verify);
|
detectorType type = getDetectorTypeFromShm(multiId, verify);
|
||||||
|
|
||||||
initSharedMemory(false, type, multiId, verify);
|
initSharedMemory(false, type, multiId, verify);
|
||||||
initializeMembers();
|
initializeMembers();
|
||||||
}
|
}
|
||||||
@ -424,41 +425,46 @@ void slsDetector::addMultipleDetectors(const char* name) {
|
|||||||
cprintf(RED, "Error: Add Multiple Detectors should not be called at this level\n");
|
cprintf(RED, "Error: Add Multiple Detectors should not be called at this level\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* pre: sharedMemory=0, thisDetector = 0
|
||||||
|
* exceptions are caught in calling function, shm unmapped and deleted
|
||||||
|
*/
|
||||||
void slsDetector::initSharedMemory(bool created, detectorType type, int multiId,
|
void slsDetector::initSharedMemory(bool created, detectorType type, int multiId,
|
||||||
bool verify) {
|
bool verify) {
|
||||||
if (sharedMemory)
|
try {
|
||||||
delete sharedMemory;
|
// calculate shared memory size
|
||||||
thisDetector = 0;
|
int sz = calculateSharedMemorySize(type);
|
||||||
|
|
||||||
// calculate shared memory size
|
// shared memory object with name
|
||||||
int sz = calculateSharedMemorySize(type);
|
sharedMemory = new SharedMemory(multiId, detId);
|
||||||
|
|
||||||
// shared memory object with name
|
// create
|
||||||
sharedMemory = new SharedMemory(multiId, detId);
|
if (created) {
|
||||||
// create
|
|
||||||
if (created) {
|
|
||||||
try {
|
|
||||||
thisDetector = (sharedSlsDetector*)sharedMemory->CreateSharedMemory(sz);
|
thisDetector = (sharedSlsDetector*)sharedMemory->CreateSharedMemory(sz);
|
||||||
} catch(...) {
|
}
|
||||||
sharedMemory->RemoveSharedMemory();
|
// open and verify version
|
||||||
|
else {
|
||||||
|
thisDetector = (sharedSlsDetector*)sharedMemory->OpenSharedMemory(sz);
|
||||||
|
if (verify && thisDetector->shmversion != SLS_SHMVERSION) {
|
||||||
|
cprintf(RED, "Single shared memory (%d-%d:)version mismatch "
|
||||||
|
"(expected 0x%x but got 0x%x)\n",
|
||||||
|
multiId, detId, SLS_SHMVERSION,
|
||||||
|
thisDetector->shmversion);
|
||||||
|
throw SharedMemoryException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch(...) {
|
||||||
|
if (sharedMemory) {
|
||||||
|
// unmap
|
||||||
|
if (thisDetector) {
|
||||||
|
sharedMemory->UnmapSharedMemory(thisDetector);
|
||||||
|
thisDetector = 0;
|
||||||
|
}
|
||||||
|
// delete
|
||||||
delete sharedMemory;
|
delete sharedMemory;
|
||||||
sharedMemory = 0;
|
sharedMemory = 0;
|
||||||
thisDetector = 0;
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// open and verify version
|
|
||||||
else {
|
|
||||||
thisDetector = (sharedSlsDetector*)sharedMemory->OpenSharedMemory(sz);
|
|
||||||
if (verify && thisDetector->shmversion != SLS_SHMVERSION) {
|
|
||||||
cprintf(RED, "Single shared memory (%d-%d:)version mismatch "
|
|
||||||
"(expected 0x%x but got 0x%x)\n",
|
|
||||||
multiId, detId, SLS_SHMVERSION, thisDetector->shmversion);
|
|
||||||
sharedMemory->UnmapSharedMemory(thisDetector); /** is this unncessary? */
|
|
||||||
delete sharedMemory;/** is this unncessary? */
|
|
||||||
sharedMemory = 0;
|
|
||||||
throw SharedMemoryException();
|
|
||||||
}
|
}
|
||||||
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1251,35 +1257,48 @@ int slsDetector::receiveModule(sls_detector_module* myMod) {
|
|||||||
|
|
||||||
|
|
||||||
slsReceiverDefs::detectorType slsDetector::getDetectorTypeFromShm(int multiId, bool verify) {
|
slsReceiverDefs::detectorType slsDetector::getDetectorTypeFromShm(int multiId, bool verify) {
|
||||||
SharedMemory* shm = new SharedMemory(multiId, detId);
|
|
||||||
// shm not created before
|
detectorType type = GENERIC;
|
||||||
if (!shm->IsExisting()) {
|
SharedMemory* shm = 0;
|
||||||
cprintf(RED,"Shared memory %s does not exist.\n"
|
|
||||||
"Corrupted Multi Shared memory. Please free shared memory.\n",
|
try {
|
||||||
shm->GetName().c_str());
|
// create
|
||||||
throw SharedMemoryException();
|
shm = new SharedMemory(multiId, detId);
|
||||||
|
|
||||||
|
// shm not created before
|
||||||
|
if (!shm->IsExisting()) {
|
||||||
|
cprintf(RED,"Shared memory %s does not exist.\n"
|
||||||
|
"Corrupted Multi Shared memory. Please free shared memory.\n",
|
||||||
|
shm->GetName().c_str());
|
||||||
|
throw SharedMemoryException();
|
||||||
|
}
|
||||||
|
|
||||||
|
// only basic size of structure (just version is required)
|
||||||
|
sharedSlsDetector* sdet = 0;
|
||||||
|
size_t sz = sizeof(sharedSlsDetector);
|
||||||
|
|
||||||
|
// open, map, verify version
|
||||||
|
sdet = (sharedSlsDetector*)shm->OpenSharedMemory(sz);
|
||||||
|
if (verify && sdet->shmversion != SLS_SHMVERSION) {
|
||||||
|
cprintf(RED, "Single shared memory (%d-%d:)version mismatch "
|
||||||
|
"(expected 0x%x but got 0x%x)\n",
|
||||||
|
multiId, detId, SLS_SHMVERSION, sdet->shmversion);
|
||||||
|
// unmap and throw
|
||||||
|
sharedMemory->UnmapSharedMemory(thisDetector);
|
||||||
|
throw SharedMemoryException();
|
||||||
|
}
|
||||||
|
|
||||||
|
// get type, unmap
|
||||||
|
type = sdet->myDetectorType;
|
||||||
|
shm->UnmapSharedMemory(sdet);
|
||||||
|
delete shm;
|
||||||
|
|
||||||
|
} catch (...) {
|
||||||
|
if (shm)
|
||||||
|
delete shm;
|
||||||
|
throw;
|
||||||
}
|
}
|
||||||
|
|
||||||
// map basic size of sls detector structure (no need of offsets, just version is required)
|
|
||||||
sharedSlsDetector* sdet = 0;
|
|
||||||
size_t sz = sizeof(sharedSlsDetector);
|
|
||||||
|
|
||||||
// open, map, verify version, get type
|
|
||||||
sdet = (sharedSlsDetector*)shm->OpenSharedMemory(sz);
|
|
||||||
if (verify && sdet->shmversion != SLS_SHMVERSION) {
|
|
||||||
cprintf(RED, "Single shared memory (%d-%d:)version mismatch "
|
|
||||||
"(expected 0x%x but got 0x%x)\n",
|
|
||||||
multiId, detId, SLS_SHMVERSION, sdet->shmversion);
|
|
||||||
shm->UnmapSharedMemory(sdet); /** is this unncessary? */
|
|
||||||
delete shm;/** is this unncessary? */
|
|
||||||
throw SharedMemoryException();
|
|
||||||
}
|
|
||||||
detectorType type = sdet->myDetectorType;
|
|
||||||
|
|
||||||
// unmap
|
|
||||||
shm->UnmapSharedMemory(sdet);
|
|
||||||
delete shm;
|
|
||||||
|
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1291,8 +1310,7 @@ slsDetectorDefs::detectorType slsDetector::getDetectorType(const char *name, int
|
|||||||
MySocketTCP* mySocket = 0;
|
MySocketTCP* mySocket = 0;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
MySocketTCP* s= new MySocketTCP(name, cport);
|
mySocket = new MySocketTCP(name, cport);
|
||||||
mySocket = s;
|
|
||||||
} catch(...) {
|
} catch(...) {
|
||||||
cout << "Cannot create socket to server " << name << " over port " << cport << endl;
|
cout << "Cannot create socket to server " << name << " over port " << cport << endl;
|
||||||
return t;
|
return t;
|
||||||
@ -1755,7 +1773,7 @@ string slsDetector::checkOnline() {
|
|||||||
controlSocket->SetTimeOut(5);
|
controlSocket->SetTimeOut(5);
|
||||||
thisDetector->onlineFlag=OFFLINE_FLAG;
|
thisDetector->onlineFlag=OFFLINE_FLAG;
|
||||||
delete controlSocket;
|
delete controlSocket;
|
||||||
controlSocket=NULL;
|
controlSocket=0;
|
||||||
retval = string(thisDetector->hostname);
|
retval = string(thisDetector->hostname);
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout<< "offline!" << std::endl;
|
std::cout<< "offline!" << std::endl;
|
||||||
@ -1775,7 +1793,7 @@ string slsDetector::checkOnline() {
|
|||||||
stopSocket->SetTimeOut(5);
|
stopSocket->SetTimeOut(5);
|
||||||
thisDetector->onlineFlag=OFFLINE_FLAG;
|
thisDetector->onlineFlag=OFFLINE_FLAG;
|
||||||
delete stopSocket;
|
delete stopSocket;
|
||||||
stopSocket=NULL;
|
stopSocket=0;
|
||||||
retval = string(thisDetector->hostname);
|
retval = string(thisDetector->hostname);
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout<< "stop offline!" << std::endl;
|
std::cout<< "stop offline!" << std::endl;
|
||||||
@ -1808,11 +1826,11 @@ int slsDetector::setTCPSocket(string const name, int const control_port, int con
|
|||||||
strcpy(thisDetector->hostname,thisName);
|
strcpy(thisDetector->hostname,thisName);
|
||||||
if (controlSocket) {
|
if (controlSocket) {
|
||||||
delete controlSocket;
|
delete controlSocket;
|
||||||
controlSocket=NULL;
|
controlSocket=0;
|
||||||
}
|
}
|
||||||
if (stopSocket) {
|
if (stopSocket) {
|
||||||
delete stopSocket;
|
delete stopSocket;
|
||||||
stopSocket=NULL;
|
stopSocket=0;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
strcpy(thisName,thisDetector->hostname);
|
strcpy(thisName,thisDetector->hostname);
|
||||||
@ -1825,7 +1843,7 @@ int slsDetector::setTCPSocket(string const name, int const control_port, int con
|
|||||||
thisDetector->controlPort=thisCP;
|
thisDetector->controlPort=thisCP;
|
||||||
if (controlSocket) {
|
if (controlSocket) {
|
||||||
delete controlSocket;
|
delete controlSocket;
|
||||||
controlSocket=NULL;
|
controlSocket=0;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
thisCP=thisDetector->controlPort;
|
thisCP=thisDetector->controlPort;
|
||||||
@ -1838,7 +1856,7 @@ int slsDetector::setTCPSocket(string const name, int const control_port, int con
|
|||||||
thisDetector->stopPort=thisSP;
|
thisDetector->stopPort=thisSP;
|
||||||
if (stopSocket) {
|
if (stopSocket) {
|
||||||
delete stopSocket;
|
delete stopSocket;
|
||||||
stopSocket=NULL;
|
stopSocket=0;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
thisSP=thisDetector->stopPort;
|
thisSP=thisDetector->stopPort;
|
||||||
@ -1847,8 +1865,7 @@ int slsDetector::setTCPSocket(string const name, int const control_port, int con
|
|||||||
// create control socket
|
// create control socket
|
||||||
if (!controlSocket) {
|
if (!controlSocket) {
|
||||||
try {
|
try {
|
||||||
MySocketTCP* s = new MySocketTCP(thisName, thisCP);
|
controlSocket = new MySocketTCP(thisName, thisCP);
|
||||||
controlSocket = s;
|
|
||||||
#ifdef VERYVERBOSE
|
#ifdef VERYVERBOSE
|
||||||
std::cout<< "Control socket connected " <<
|
std::cout<< "Control socket connected " <<
|
||||||
thisName << " " << thisCP << std::endl;
|
thisName << " " << thisCP << std::endl;
|
||||||
@ -1858,7 +1875,7 @@ int slsDetector::setTCPSocket(string const name, int const control_port, int con
|
|||||||
std::cout<< "Could not connect Control socket " <<
|
std::cout<< "Could not connect Control socket " <<
|
||||||
thisName << " " << thisCP << std::endl;
|
thisName << " " << thisCP << std::endl;
|
||||||
#endif
|
#endif
|
||||||
controlSocket = NULL;
|
controlSocket = 0;
|
||||||
retval = FAIL;
|
retval = FAIL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1867,8 +1884,7 @@ int slsDetector::setTCPSocket(string const name, int const control_port, int con
|
|||||||
// create stop socket
|
// create stop socket
|
||||||
if (!stopSocket) {
|
if (!stopSocket) {
|
||||||
try {
|
try {
|
||||||
MySocketTCP* s = new MySocketTCP(thisName, thisSP);
|
stopSocket = new MySocketTCP(thisName, thisSP);
|
||||||
stopSocket = s;
|
|
||||||
#ifdef VERYVERBOSE
|
#ifdef VERYVERBOSE
|
||||||
std::cout<< "Stop socket connected " <<
|
std::cout<< "Stop socket connected " <<
|
||||||
thisName << " " << thisSP << std::endl;
|
thisName << " " << thisSP << std::endl;
|
||||||
@ -1878,7 +1894,7 @@ int slsDetector::setTCPSocket(string const name, int const control_port, int con
|
|||||||
std::cout<< "Could not connect Stop socket " <<
|
std::cout<< "Could not connect Stop socket " <<
|
||||||
thisName << " " << thisSP << std::endl;
|
thisName << " " << thisSP << std::endl;
|
||||||
#endif
|
#endif
|
||||||
stopSocket = NULL;
|
stopSocket = 0;
|
||||||
retval = FAIL;
|
retval = FAIL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1921,7 +1937,7 @@ int slsDetector::setPort(portType index, int num) {
|
|||||||
char mess[MAX_STR_LENGTH]="";
|
char mess[MAX_STR_LENGTH]="";
|
||||||
int ret=FAIL;
|
int ret=FAIL;
|
||||||
bool online=false;
|
bool online=false;
|
||||||
MySocketTCP *s;
|
MySocketTCP *s = 0;
|
||||||
|
|
||||||
if (num>1024) {
|
if (num>1024) {
|
||||||
switch(index) {
|
switch(index) {
|
||||||
@ -1933,7 +1949,7 @@ int slsDetector::setPort(portType index, int num) {
|
|||||||
cout << thisDetector->controlPort<< " " << " " << thisDetector->stopPort
|
cout << thisDetector->controlPort<< " " << " " << thisDetector->stopPort
|
||||||
<< endl;
|
<< endl;
|
||||||
#endif
|
#endif
|
||||||
if (s==NULL) {
|
if (s==0) {
|
||||||
|
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "s=NULL"<< endl;
|
cout << "s=NULL"<< endl;
|
||||||
@ -1971,7 +1987,7 @@ int slsDetector::setPort(portType index, int num) {
|
|||||||
s=dataSocket;
|
s=dataSocket;
|
||||||
retval=thisDetector->receiverTCPPort;
|
retval=thisDetector->receiverTCPPort;
|
||||||
if(strcmp(thisDetector->receiver_hostname,"none")){
|
if(strcmp(thisDetector->receiver_hostname,"none")){
|
||||||
if (s==NULL) setReceiverTCPSocket("",retval);
|
if (s==0) setReceiverTCPSocket("",retval);
|
||||||
if (dataSocket)s=dataSocket;
|
if (dataSocket)s=dataSocket;
|
||||||
}
|
}
|
||||||
online = (thisDetector->receiverOnlineFlag==ONLINE_FLAG);
|
online = (thisDetector->receiverOnlineFlag==ONLINE_FLAG);
|
||||||
@ -1991,7 +2007,7 @@ int slsDetector::setPort(portType index, int num) {
|
|||||||
case STOP_PORT:
|
case STOP_PORT:
|
||||||
s=stopSocket;
|
s=stopSocket;
|
||||||
retval=thisDetector->stopPort;
|
retval=thisDetector->stopPort;
|
||||||
if (s==NULL) setTCPSocket("",-1,DEFAULT_PORTNO+1);
|
if (s==0) setTCPSocket("",-1,DEFAULT_PORTNO+1);
|
||||||
if (stopSocket) s=stopSocket;
|
if (stopSocket) s=stopSocket;
|
||||||
else setTCPSocket("",-1,retval);
|
else setTCPSocket("",-1,retval);
|
||||||
online = (thisDetector->onlineFlag==ONLINE_FLAG);
|
online = (thisDetector->onlineFlag==ONLINE_FLAG);
|
||||||
@ -2008,7 +2024,7 @@ int slsDetector::setPort(portType index, int num) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
s=NULL;
|
s=0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8271,7 +8287,7 @@ string slsDetector::checkReceiverOnline() {
|
|||||||
dataSocket->SetTimeOut(5);
|
dataSocket->SetTimeOut(5);
|
||||||
thisDetector->receiverOnlineFlag=OFFLINE_FLAG;
|
thisDetector->receiverOnlineFlag=OFFLINE_FLAG;
|
||||||
delete dataSocket;
|
delete dataSocket;
|
||||||
dataSocket=NULL;
|
dataSocket=0;
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout<< "receiver offline!" << std::endl;
|
std::cout<< "receiver offline!" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
@ -8308,7 +8324,7 @@ int slsDetector::setReceiverTCPSocket(string const name, int const receiver_port
|
|||||||
strcpy(thisDetector->receiver_hostname,thisName);
|
strcpy(thisDetector->receiver_hostname,thisName);
|
||||||
if (dataSocket){
|
if (dataSocket){
|
||||||
delete dataSocket;
|
delete dataSocket;
|
||||||
dataSocket=NULL;
|
dataSocket=0;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
strcpy(thisName,thisDetector->receiver_hostname);
|
strcpy(thisName,thisDetector->receiver_hostname);
|
||||||
@ -8322,7 +8338,7 @@ int slsDetector::setReceiverTCPSocket(string const name, int const receiver_port
|
|||||||
thisDetector->receiverTCPPort=thisRP;
|
thisDetector->receiverTCPPort=thisRP;
|
||||||
if (dataSocket){
|
if (dataSocket){
|
||||||
delete dataSocket;
|
delete dataSocket;
|
||||||
dataSocket=NULL;
|
dataSocket=0;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
thisRP=thisDetector->receiverTCPPort;
|
thisRP=thisDetector->receiverTCPPort;
|
||||||
@ -8330,8 +8346,7 @@ int slsDetector::setReceiverTCPSocket(string const name, int const receiver_port
|
|||||||
//create data socket
|
//create data socket
|
||||||
if (!dataSocket) {
|
if (!dataSocket) {
|
||||||
try {
|
try {
|
||||||
MySocketTCP* s = new MySocketTCP(thisName, thisRP);
|
dataSocket = new MySocketTCP(thisName, thisRP);
|
||||||
dataSocket = s;
|
|
||||||
#ifdef VERYVERBOSE
|
#ifdef VERYVERBOSE
|
||||||
std::cout<< "Data socket connected " <<
|
std::cout<< "Data socket connected " <<
|
||||||
thisName << " " << thisRP << std::endl;
|
thisName << " " << thisRP << std::endl;
|
||||||
@ -8341,7 +8356,7 @@ int slsDetector::setReceiverTCPSocket(string const name, int const receiver_port
|
|||||||
std::cout<< "Could not connect Data socket " <<
|
std::cout<< "Could not connect Data socket " <<
|
||||||
thisName << " " << thisRP << std::endl;
|
thisName << " " << thisRP << std::endl;
|
||||||
#endif
|
#endif
|
||||||
dataSocket = NULL;
|
dataSocket = 0;
|
||||||
retval = FAIL;
|
retval = FAIL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -271,16 +271,14 @@ public:
|
|||||||
dset->extend(dims);
|
dset->extend(dims);
|
||||||
delete dspace;
|
delete dspace;
|
||||||
dspace = 0;
|
dspace = 0;
|
||||||
DataSpace* d = new DataSpace(dset->getSpace());
|
dspace = new DataSpace(dset->getSpace());
|
||||||
dspace = d;
|
|
||||||
|
|
||||||
hsize_t dims_para[1] = {dims[0]};
|
hsize_t dims_para[1] = {dims[0]};
|
||||||
for (unsigned int i = 0; i < dset_para.size(); ++i)
|
for (unsigned int i = 0; i < dset_para.size(); ++i)
|
||||||
dset_para[i]->extend(dims_para);
|
dset_para[i]->extend(dims_para);
|
||||||
delete dspace_para;
|
delete dspace_para;
|
||||||
dspace_para = 0;
|
dspace_para = 0;
|
||||||
DataSpace* ds = new DataSpace(dset_para[0]->getSpace());
|
dspace_para = new DataSpace(dset_para[0]->getSpace());
|
||||||
dspace_para = ds;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch(Exception error){
|
catch(Exception error){
|
||||||
@ -322,16 +320,15 @@ public:
|
|||||||
|
|
||||||
FileAccPropList flist;
|
FileAccPropList flist;
|
||||||
flist.setFcloseDegree(H5F_CLOSE_STRONG);
|
flist.setFcloseDegree(H5F_CLOSE_STRONG);
|
||||||
int k = 0;
|
fd = 0;
|
||||||
if(!owenable)
|
if(!owenable)
|
||||||
k = new H5File( fname.c_str(), H5F_ACC_EXCL,
|
fd = new H5File( fname.c_str(), H5F_ACC_EXCL,
|
||||||
FileCreatPropList::DEFAULT,
|
FileCreatPropList::DEFAULT,
|
||||||
flist );
|
flist );
|
||||||
else
|
else
|
||||||
k = new H5File( fname.c_str(), H5F_ACC_TRUNC,
|
fd = new H5File( fname.c_str(), H5F_ACC_TRUNC,
|
||||||
FileCreatPropList::DEFAULT,
|
FileCreatPropList::DEFAULT,
|
||||||
flist );
|
flist );
|
||||||
fd = k;
|
|
||||||
|
|
||||||
//variables
|
//variables
|
||||||
DataSpace dataspace = DataSpace (H5S_SCALAR);
|
DataSpace dataspace = DataSpace (H5S_SCALAR);
|
||||||
@ -466,16 +463,15 @@ public:
|
|||||||
//file
|
//file
|
||||||
FileAccPropList fapl;
|
FileAccPropList fapl;
|
||||||
fapl.setFcloseDegree(H5F_CLOSE_STRONG);
|
fapl.setFcloseDegree(H5F_CLOSE_STRONG);
|
||||||
int k = 0;
|
fd = 0;
|
||||||
if(!owenable)
|
if(!owenable)
|
||||||
k = new H5File( fname.c_str(), H5F_ACC_EXCL,
|
fd = new H5File( fname.c_str(), H5F_ACC_EXCL,
|
||||||
FileCreatPropList::DEFAULT,
|
FileCreatPropList::DEFAULT,
|
||||||
fapl );
|
fapl );
|
||||||
else
|
else
|
||||||
k = new H5File( fname.c_str(), H5F_ACC_TRUNC,
|
fd = new H5File( fname.c_str(), H5F_ACC_TRUNC,
|
||||||
FileCreatPropList::DEFAULT,
|
FileCreatPropList::DEFAULT,
|
||||||
fapl );
|
fapl );
|
||||||
fd = k;
|
|
||||||
|
|
||||||
//attributes - version
|
//attributes - version
|
||||||
double dValue=version;
|
double dValue=version;
|
||||||
@ -486,8 +482,8 @@ public:
|
|||||||
//dataspace
|
//dataspace
|
||||||
hsize_t srcdims[3] = {nDimx, nDimy, nDimz};
|
hsize_t srcdims[3] = {nDimx, nDimy, nDimz};
|
||||||
hsize_t srcdimsmax[3] = {H5S_UNLIMITED, nDimy, nDimz};
|
hsize_t srcdimsmax[3] = {H5S_UNLIMITED, nDimy, nDimz};
|
||||||
DataSpace* d = new DataSpace (3,srcdims,srcdimsmax);
|
dspace = 0;
|
||||||
dspace = d;
|
dspace = new DataSpace (3,srcdims,srcdimsmax);
|
||||||
|
|
||||||
|
|
||||||
//dataset name
|
//dataset name
|
||||||
@ -504,14 +500,14 @@ public:
|
|||||||
// always create chunked dataset as unlimited is only supported with chunked layout
|
// always create chunked dataset as unlimited is only supported with chunked layout
|
||||||
hsize_t chunk_dims[3] ={maxchunkedimages, nDimy, nDimz};
|
hsize_t chunk_dims[3] ={maxchunkedimages, nDimy, nDimz};
|
||||||
plist.setChunk(3, chunk_dims);
|
plist.setChunk(3, chunk_dims);
|
||||||
DataSet* ds = new DataSet (fd->createDataSet(dsetname.c_str(), dtype, *dspace, plist));
|
dset = 0;
|
||||||
dset = ds;
|
dset = new DataSet (fd->createDataSet(dsetname.c_str(), dtype, *dspace, plist));
|
||||||
|
|
||||||
//create parameter datasets
|
//create parameter datasets
|
||||||
hsize_t dims[1] = {nDimx};
|
hsize_t dims[1] = {nDimx};
|
||||||
hsize_t dimsmax[1] = {H5S_UNLIMITED};
|
hsize_t dimsmax[1] = {H5S_UNLIMITED};
|
||||||
DataSpace* dsp = new DataSpace (1,dims,dimsmax);
|
dspace_para = 0;
|
||||||
dspace_para = dsp;
|
dspace_para = new DataSpace (1,dims,dimsmax);
|
||||||
|
|
||||||
// always create chunked dataset as unlimited is only supported with chunked layout
|
// always create chunked dataset as unlimited is only supported with chunked layout
|
||||||
DSetCreatPropList paralist;
|
DSetCreatPropList paralist;
|
||||||
@ -842,6 +838,7 @@ public:
|
|||||||
//new file
|
//new file
|
||||||
FileAccPropList fapl;
|
FileAccPropList fapl;
|
||||||
fapl.setFcloseDegree(H5F_CLOSE_STRONG);
|
fapl.setFcloseDegree(H5F_CLOSE_STRONG);
|
||||||
|
newfd = 0;
|
||||||
if(!owenable)
|
if(!owenable)
|
||||||
newfd = new H5File( newFileName.c_str(), H5F_ACC_EXCL,
|
newfd = new H5File( newFileName.c_str(), H5F_ACC_EXCL,
|
||||||
FileCreatPropList::DEFAULT,
|
FileCreatPropList::DEFAULT,
|
||||||
@ -851,7 +848,7 @@ public:
|
|||||||
FileCreatPropList::DEFAULT,
|
FileCreatPropList::DEFAULT,
|
||||||
fapl );
|
fapl );
|
||||||
//dataspace and dataset
|
//dataspace and dataset
|
||||||
DataSpace* newDataspace;
|
DataSpace* newDataspace = 0;
|
||||||
if (rank == 3) {
|
if (rank == 3) {
|
||||||
hsize_t dims[3] = {nDimx, nDimy, nDimz};
|
hsize_t dims[3] = {nDimx, nDimy, nDimz};
|
||||||
newDataspace = new DataSpace (3,dims);
|
newDataspace = new DataSpace (3,dims);
|
||||||
@ -859,7 +856,8 @@ public:
|
|||||||
hsize_t dims[2] = {nDimx, nDimy};
|
hsize_t dims[2] = {nDimx, nDimy};
|
||||||
newDataspace = new DataSpace (2,dims);
|
newDataspace = new DataSpace (2,dims);
|
||||||
}
|
}
|
||||||
DataSet* newDataset = new DataSet( newfd->createDataSet(newDatasetName.c_str(), datatype, *newDataspace));
|
DataSet* newDataset = 0;
|
||||||
|
newDataset = new DataSet( newfd->createDataSet(newDatasetName.c_str(), datatype, *newDataspace));
|
||||||
//write and close
|
//write and close
|
||||||
newDataset->write(data_out,datatype);
|
newDataset->write(data_out,datatype);
|
||||||
newfd->close();
|
newfd->close();
|
||||||
|
@ -10,26 +10,30 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <exception>
|
#include <exception>
|
||||||
|
|
||||||
|
struct SlsDetectorPackageExceptions : public std::exception {
|
||||||
|
public:
|
||||||
|
SlsDetectorPackageExceptions() {}
|
||||||
|
std::string GetMessage() const { return "SLS Detector Package Failed";};
|
||||||
|
};
|
||||||
|
|
||||||
struct SharedMemoryException : public std::exception {
|
struct SharedMemoryException : public SlsDetectorPackageExceptions {
|
||||||
public:
|
public:
|
||||||
SharedMemoryException() {}
|
SharedMemoryException() {}
|
||||||
std::string GetMessage() const { return "Shared Memory Failed";};
|
std::string GetMessage() const { return "Shared Memory Failed";};
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ThreadpoolException : public std::exception {
|
struct ThreadpoolException : public SlsDetectorPackageExceptions {
|
||||||
public:
|
public:
|
||||||
ThreadpoolException() {}
|
ThreadpoolException() {}
|
||||||
std::string GetMessage() const { return "Threadpool Failed";};
|
std::string GetMessage() const { return "Threadpool Failed";};
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SocketException : public std::exception {
|
struct SocketException : public SlsDetectorPackageExceptions {
|
||||||
public:
|
public:
|
||||||
SocketException() {}
|
SocketException() {}
|
||||||
std::string GetMessage() const { return "Socket Failed";};
|
std::string GetMessage() const { return "Socket Failed";};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct SamePortSocketException : public SocketException {
|
struct SamePortSocketException : public SocketException {
|
||||||
public:
|
public:
|
||||||
SamePortSocketException() {}
|
SamePortSocketException() {}
|
||||||
|
@ -132,8 +132,7 @@ void DataStreamer::CreateZmqSockets(int* nunits, uint32_t port, const char* srci
|
|||||||
uint32_t portnum = port + index;
|
uint32_t portnum = port + index;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ZmqSocket* z = new ZmqSocket(portnum, (strlen(srcip)?srcip:NULL));
|
zmqSocket = new ZmqSocket(portnum, (strlen(srcip)?srcip:NULL));
|
||||||
zmqSocket = z;
|
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
cprintf(RED, "Error: Could not create Zmq socket on port %d for Streamer %d\n", portnum, index);
|
cprintf(RED, "Error: Could not create Zmq socket on port %d for Streamer %d\n", portnum, index);
|
||||||
throw;
|
throw;
|
||||||
|
@ -194,10 +194,9 @@ int Listener::CreateUDPSockets() {
|
|||||||
ShutDownUDPSocket();
|
ShutDownUDPSocket();
|
||||||
|
|
||||||
try{
|
try{
|
||||||
genericSocket* g = new genericSocket(*udpPortNumber, genericSocket::UDP,
|
udpSocket = new genericSocket(*udpPortNumber, genericSocket::UDP,
|
||||||
generalData->packetSize, (strlen(eth)?eth:NULL), generalData->headerPacketSize,
|
generalData->packetSize, (strlen(eth)?eth:NULL), generalData->headerPacketSize,
|
||||||
*udpSocketBufferSize);
|
*udpSocketBufferSize);
|
||||||
udpSocket = g;
|
|
||||||
FILE_LOG(logINFO) << index << ": UDP port opened at port " << *udpPortNumber;
|
FILE_LOG(logINFO) << index << ": UDP port opened at port " << *udpPortNumber;
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
FILE_LOG(logERROR) << "Could not create UDP socket on port " << *udpPortNumber;
|
FILE_LOG(logERROR) << "Could not create UDP socket on port " << *udpPortNumber;
|
||||||
@ -254,10 +253,9 @@ int Listener::CreateDummySocketForUDPSocketBufferSize(uint32_t s) {
|
|||||||
|
|
||||||
//create dummy socket
|
//create dummy socket
|
||||||
try {
|
try {
|
||||||
genericSocket* g = new genericSocket(*udpPortNumber, genericSocket::UDP,
|
udpSocket = new genericSocket(*udpPortNumber, genericSocket::UDP,
|
||||||
generalData->packetSize, (strlen(eth)?eth:NULL), generalData->headerPacketSize,
|
generalData->packetSize, (strlen(eth)?eth:NULL), generalData->headerPacketSize,
|
||||||
*udpSocketBufferSize);
|
*udpSocketBufferSize);
|
||||||
udpSocket = g;
|
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
FILE_LOG(logERROR) << "Could not create a test UDP socket on port " << *udpPortNumber;
|
FILE_LOG(logERROR) << "Could not create a test UDP socket on port " << *udpPortNumber;
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user