summaryrefslogtreecommitdiffstats
path: root/src/mad.cpp
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2008-09-14 23:16:58 +0200
committerMatthias Schiffer <matthias@gamezock.de>2008-09-14 23:16:58 +0200
commit082dac7a8cb39ec1b005680680c4f3e1e8ddc256 (patch)
tree1db7b02d84cdd1882e15d3a1abfd8e93925a4af6 /src/mad.cpp
parentfd9b1506a3b3858235e91cce45805f6d54caae4f (diff)
downloadmad-082dac7a8cb39ec1b005680680c4f3e1e8ddc256.tar
mad-082dac7a8cb39ec1b005680680c4f3e1e8ddc256.zip
Verwende statische Instanzen von ConfigManager, ConnectionManager und RequestManager (Singleton)
Diffstat (limited to 'src/mad.cpp')
-rw-r--r--src/mad.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/mad.cpp b/src/mad.cpp
index 613747b..a70be5a 100644
--- a/src/mad.cpp
+++ b/src/mad.cpp
@@ -29,7 +29,7 @@
int main() {
Mad::Net::Connection::init();
- Mad::Common::RequestManager requestManager(false);
+ Mad::Common::RequestManager::init(false);
Mad::Net::ClientConnection *connection = new Mad::Net::ClientConnection;
try {
@@ -42,11 +42,12 @@ int main() {
connection->sendReceive(fd.revents);
}
- requestManager.registerConnection(connection);
+ Mad::Common::RequestManager::getRequestManager()->registerConnection(connection);
- char hostname[256];
- gethostname(hostname, sizeof(hostname));
- Mad::Common::Requests::IdentifyRequest::send(connection, requestManager, hostname);
+ //char hostname[256];
+ //gethostname(hostname, sizeof(hostname));
+ //Mad::Common::Requests::IdentifyRequest::send(connection, hostname);
+ Mad::Common::Requests::IdentifyRequest::send(connection, "test");
while(connection->isConnected()) {
struct pollfd fd = connection->getPollfd();
@@ -55,7 +56,7 @@ int main() {
connection->sendReceive(fd.revents);
}
- requestManager.unregisterConnection(connection);
+ Mad::Common::RequestManager::getRequestManager()->unregisterConnection(connection);
}
catch(Mad::Net::Exception &e) {
std::cerr << "Connection error: " << e.what() << std::endl;