diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2008-09-29 22:58:39 +0200 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2008-09-29 22:58:39 +0200 |
commit | 4f8c2ba997d4f89b392a3b0683773a71d21a4f80 (patch) | |
tree | 5e42e5a3a2f4c1437acf20ddcaf3c50b8c61990e /src/Core/ConnectionManager.cpp | |
parent | d90eb49281efcf2db039fbaacccebd4acdc15f7f (diff) | |
download | mad-4f8c2ba997d4f89b392a3b0683773a71d21a4f80.tar mad-4f8c2ba997d4f89b392a3b0683773a71d21a4f80.zip |
Abfrage des Quell-Daemon-Namens eines Requests m?glich f?r RemoteLogger
Diffstat (limited to 'src/Core/ConnectionManager.cpp')
-rw-r--r-- | src/Core/ConnectionManager.cpp | 9 |
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 |