summaryrefslogtreecommitdiffstats
path: root/src/Server/ConnectionManager.cpp
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-05-06 17:39:30 +0200
committerMatthias Schiffer <matthias@gamezock.de>2009-05-06 17:39:30 +0200
commit8324b947487f72fd8cfc439ea5ae5bd1187fff1b (patch)
treee7fb69f3207654b5e3d4ba260d3f51082b1d399a /src/Server/ConnectionManager.cpp
parent5bf3e2229015d93808bb0c2f4729c2c4f4da414e (diff)
downloadmad-8324b947487f72fd8cfc439ea5ae5bd1187fff1b.tar
mad-8324b947487f72fd8cfc439ea5ae5bd1187fff1b.zip
Exception und ThreadHandler nach Net verschoben
Diffstat (limited to 'src/Server/ConnectionManager.cpp')
-rw-r--r--src/Server/ConnectionManager.cpp30
1 files changed, 15 insertions, 15 deletions
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<const Connection*>(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<Connection*>(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);