From 8324b947487f72fd8cfc439ea5ae5bd1187fff1b Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 6 May 2009 17:39:30 +0200 Subject: Exception und ThreadHandler nach Net verschoben --- src/Server/ConnectionManager.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/Server/ConnectionManager.cpp') diff --git a/src/Server/ConnectionManager.cpp b/src/Server/ConnectionManager.cpp index 279304c..9235700 100644 --- a/src/Server/ConnectionManager.cpp +++ b/src/Server/ConnectionManager.cpp @@ -46,8 +46,8 @@ namespace Server { ConnectionManager ConnectionManager::connectionManager; -bool ConnectionManager::Connection::send(const Net::Packet &packet) { - return connection->send(packet); +void ConnectionManager::Connection::send(const Net::Packet &packet) { + connection->send(packet); } ConnectionManager::Connection::Connection(Net::ServerConnection *connection0, ConnectionType type0) @@ -100,7 +100,7 @@ bool ConnectionManager::handleConfigEntry(const Common::ConfigEntry &entry, bool try { listenerAddresses.push_back(Net::IPAddress(entry[0][0])); } - catch(Common::Exception &e) { + catch(Net::Exception &e) { // TODO Log error } @@ -149,7 +149,7 @@ void ConnectionManager::configFinished() { try { listeners.push_back(new Net::Listener(x509CertFile, x509KeyFile)); } - catch(Common::Exception &e) { + catch(Net::Exception &e) { // TODO Log error } } @@ -158,7 +158,7 @@ void ConnectionManager::configFinished() { try { listeners.push_back(new Net::Listener(x509CertFile, x509KeyFile, *address)); } - catch(Common::Exception &e) { + catch(Net::Exception &e) { // TODO Log error } } @@ -233,14 +233,14 @@ void ConnectionManager::run() { } } -Common::Connection* ConnectionManager::getDaemonConnection(const std::string &name) const throw (Common::Exception&) { +Common::Connection* ConnectionManager::getDaemonConnection(const std::string &name) const throw (Net::Exception&) { const Common::HostInfo *hostInfo; try { hostInfo = &daemonInfo.at(name); } catch(std::out_of_range&) { - throw Common::Exception(Common::Exception::UNKNOWN_DAEMON); + throw Net::Exception(Net::Exception::UNKNOWN_DAEMON); } if(hostInfo->getState() != Common::HostInfo::INACTIVE) { @@ -251,10 +251,10 @@ Common::Connection* ConnectionManager::getDaemonConnection(const std::string &na } } - throw(Common::Exception::NOT_AVAILABLE); + throw(Net::Exception::NOT_AVAILABLE); } -std::string ConnectionManager::getDaemonName(const Common::Connection *con) const throw (Common::Exception&) { +std::string ConnectionManager::getDaemonName(const Common::Connection *con) const throw (Net::Exception&) { const Connection *connection = dynamic_cast(con); if(connection) { @@ -263,22 +263,22 @@ std::string ConnectionManager::getDaemonName(const Common::Connection *con) cons } } - throw Common::Exception(Common::Exception::UNKNOWN_DAEMON); + throw Net::Exception(Net::Exception::UNKNOWN_DAEMON); } -void ConnectionManager::identifyDaemonConnection(Common::Connection *con, const std::string &name) throw (Common::Exception&) { +void ConnectionManager::identifyDaemonConnection(Common::Connection *con, const std::string &name) throw (Net::Exception&) { // TODO Logging Connection *connection = dynamic_cast(con); if(!connection || (connection->getConnectionType() != Connection::DAEMON)) - throw Common::Exception(Common::Exception::INVALID_ACTION); + throw Net::Exception(Net::Exception::INVALID_ACTION); if(connection->isIdentified()) - throw Common::Exception(Common::Exception::ALREADY_IDENTIFIED); + throw Net::Exception(Net::Exception::ALREADY_IDENTIFIED); if(daemonInfo.count(name) == 0) - throw Common::Exception(Common::Exception::UNKNOWN_DAEMON); + throw Net::Exception(Net::Exception::UNKNOWN_DAEMON); Common::HostInfo *hostInfo = &daemonInfo[name]; @@ -287,7 +287,7 @@ void ConnectionManager::identifyDaemonConnection(Common::Connection *con, const getDaemonConnection(name)->disconnect(); Common::Logger::log(Common::Logger::WARNING, "Disconnecting old connection."); } - catch(Common::Exception&) {} + catch(Net::Exception&) {} } connection->identify(hostInfo); -- cgit v1.2.3