diff options
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; |