From e3c0c95f2ad3d25411c007ce4ffdb25084a1bc0d Mon Sep 17 00:00:00 2001 From: Jonas Suhr Christensen Date: Thu, 12 Apr 2012 15:12:18 +0200 Subject: Added observer id as prefix to server->client commands. --- src/connectionhandler.cc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/connectionhandler.cc') 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 ConnectionHandler::observerlist(TaskIdList tasks) +std::list > +ConnectionHandler::observerlist(TaskIdList tasks) { printf("Observerlist request\n"); - std::set clients; + std::list > clients; for(TaskIdList::iterator i = tasks.begin(); i != tasks.end(); i++) { taskid_t tid = *i; + // std::set clientList; + // std::map + printf("Locating observers of node %d\n", tid); for(ConnectionList::iterator ci = connlist.begin(); ci != connlist.end(); ci++) { std::set::iterator ti = ci->second.find(tid); - if(ti != ci->second.end()) clients.insert(ci->first); + if(ti != ci->second.end()) { + std::pair m; + m.first = ci->first; + m.second = tid; + clients.push_back(m); + } } } -- cgit v1.2.3