Exceptions: zmq socket class descriptors made into its own class for auto destruction upon construction exception, similarly for other try blocks. slsDetector and multislsdetector left to do

This commit is contained in:
2018-08-09 18:12:56 +02:00
parent 1102153d2b
commit a0512a01d5
7 changed files with 140 additions and 138 deletions

View File

@ -132,7 +132,8 @@ void DataStreamer::CreateZmqSockets(int* nunits, uint32_t port, const char* srci
uint32_t portnum = port + index;
try {
zmqSocket = new ZmqSocket(portnum, (strlen(srcip)?srcip:NULL));
ZmqSocket* z = new ZmqSocket(portnum, (strlen(srcip)?srcip:NULL));
zmqSocket = z;
} catch (...) {
cprintf(RED, "Error: Could not create Zmq socket on port %d for Streamer %d\n", portnum, index);
throw;