summaryrefslogtreecommitdiff
path: root/src/connectionhandler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/connectionhandler.cc')
-rw-r--r--src/connectionhandler.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/connectionhandler.cc b/src/connectionhandler.cc
index 85ae4a7..56c465f 100644
--- a/src/connectionhandler.cc
+++ b/src/connectionhandler.cc
@@ -65,18 +65,27 @@ void ConnectionHandler::unobserve(clientid_t clientid, taskid_t taskid)
connlist[clientid].erase(taskid);
}
-std::set<clientid_t> ConnectionHandler::observerlist(TaskIdList tasks)
+std::list<std::pair<clientid_t, taskid_t> >
+ConnectionHandler::observerlist(TaskIdList tasks)
{
printf("Observerlist request\n");
- std::set<clientid_t> clients;
+ std::list<std::pair<clientid_t, taskid_t> > clients;
for(TaskIdList::iterator i = tasks.begin(); i != tasks.end(); i++) {
taskid_t tid = *i;
+ // std::set<clientid_t> clientList;
+ // std::map<clientid_t, taskid_t>
+
printf("Locating observers of node %d\n", tid);
for(ConnectionList::iterator ci = connlist.begin();
ci != connlist.end(); ci++) {
std::set<taskid_t>::iterator ti = ci->second.find(tid);
- if(ti != ci->second.end()) clients.insert(ci->first);
+ if(ti != ci->second.end()) {
+ std::pair<clientid_t, taskid_t> m;
+ m.first = ci->first;
+ m.second = tid;
+ clients.push_back(m);
+ }
}
}