summaryrefslogtreecommitdiffstats
path: root/src/Server/ConnectionManager.h
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-05-15 17:30:40 +0200
committerMatthias Schiffer <matthias@gamezock.de>2009-05-15 17:30:40 +0200
commitc8d469cc3de8ef2fb95f7b47355ebf5318a4c22f (patch)
tree2cb0bd20306f89f3da11ff22b19865ed99225b2f /src/Server/ConnectionManager.h
parent8324b947487f72fd8cfc439ea5ae5bd1187fff1b (diff)
downloadmad-c8d469cc3de8ef2fb95f7b47355ebf5318a4c22f.tar
mad-c8d469cc3de8ef2fb95f7b47355ebf5318a4c22f.zip
Einfache (ziemlich kaputte) Multithreaded IO
Diffstat (limited to 'src/Server/ConnectionManager.h')
-rw-r--r--src/Server/ConnectionManager.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/Server/ConnectionManager.h b/src/Server/ConnectionManager.h
index 62ecc37..691d51f 100644
--- a/src/Server/ConnectionManager.h
+++ b/src/Server/ConnectionManager.h
@@ -23,6 +23,7 @@
#include <list>
#include <vector>
#include <map>
+#include <set>
#include <Common/Configurable.h>
#include <Common/HostInfo.h>
@@ -55,10 +56,10 @@ class ConnectionManager : public Common::Configurable, public Common::Initializa
Common::HostInfo *hostInfo;
protected:
- virtual void send(const Net::Packet &packet);
+ virtual bool send(const Net::Packet &packet);
public:
- Connection(Net::ServerConnection *connection0, ConnectionType type0);
+ Connection(Net::ServerConnection *connection0);
virtual ~Connection();
bool isConnected() const;
@@ -91,7 +92,7 @@ class ConnectionManager : public Common::Configurable, public Common::Initializa
std::vector<Net::IPAddress> listenerAddresses;
std::list<Net::Listener*> listeners;
- std::list<Connection*> connections;
+ std::set<Connection*> connections;
std::map<std::string,Common::HostInfo> daemonInfo;
@@ -103,6 +104,9 @@ class ConnectionManager : public Common::Configurable, public Common::Initializa
ConnectionManager() {}
+ void newConnectionHandler(Net::ServerConnection *con);
+ void disconnectHandler(Connection *con);
+
protected:
virtual bool handleConfigEntry(const Common::ConfigEntry &entry, bool handled);
virtual void configFinished();
@@ -115,8 +119,6 @@ class ConnectionManager : public Common::Configurable, public Common::Initializa
return &connectionManager;
}
- void run();
-
Common::Connection* getDaemonConnection(const std::string &name) const throw (Net::Exception&);
std::string getDaemonName(const Common::Connection *con) const throw (Net::Exception&);