-
Notifications
You must be signed in to change notification settings - Fork 0
/
TrDAQSeniorManager.cc
35 lines (29 loc) · 967 Bytes
/
TrDAQSeniorManager.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "TrDAQSeniorManager.hh"
#include <pthread.h>
//TrDAQSeniorManager::TrDAQSeniorManager() {}
int TrDAQSeniorManager::setup() {
TrSocketClient trackerOne = TrSocketClient();
//trackerOne.setup();
const char* port = "5556";
const char* host = "localhost";
trackerOne.setup(port, host);
employeeConnections.insert(std::pair<int, TrSocketClient>(1,trackerOne));
return 0;
}
int TrDAQSeniorManager::sendGoCommand() {
std::map<int, TrSocketClient>::iterator it;
int readBacks = 0;
//int size = sizeof(int);
//int *volume = &size;
for (it=employeeConnections.begin(); it != employeeConnections.end(); it++) {
//pthread_t thread;
(it->second).sendData(&goCommands["go"],sizeof(int));
//int threadID = pthread_create( &thread, NULL, (it->second).receiveThreadedData, (void*)volume);
readBacks |= *(it->second).receiveData(sizeof(int));
}
if (readBacks == 0x3) {}
return readBacks;
}
int TrDAQSeniorManager::listenForData() {
return 0;
}