summaryrefslogtreecommitdiffstats
path: root/src/Core/ConnectionManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Core/ConnectionManager.cpp')
-rw-r--r--src/Core/ConnectionManager.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Core/ConnectionManager.cpp b/src/Core/ConnectionManager.cpp
index c83f3aa..93d6d3f 100644
--- a/src/Core/ConnectionManager.cpp
+++ b/src/Core/ConnectionManager.cpp
@@ -190,6 +190,15 @@ Net::Connection* ConnectionManager::getDaemonConnection(const std::string &name)
return daemon->second;
}
+std::string ConnectionManager::getDaemonName(const Net::Connection *con) const throw (Common::Exception&) {
+ for(std::map<std::string,Net::ServerConnection*>::const_iterator daemon = identifiedDaemonConnections.begin(); daemon != identifiedDaemonConnections.end(); ++daemon) {
+ if(daemon->second == con)
+ return daemon->first;
+ }
+
+ throw Common::Exception(Common::Exception::UNKNOWN_DAEMON);
+}
+
void ConnectionManager::identifyDaemonConnection(Net::Connection *connection, const std::string &name) throw (Common::Exception&) {
// TODO Logging