diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2008-09-14 23:16:58 +0200 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2008-09-14 23:16:58 +0200 |
commit | 082dac7a8cb39ec1b005680680c4f3e1e8ddc256 (patch) | |
tree | 1db7b02d84cdd1882e15d3a1abfd8e93925a4af6 /src/mad.cpp | |
parent | fd9b1506a3b3858235e91cce45805f6d54caae4f (diff) | |
download | mad-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.cpp | 13 |
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; |