summaryrefslogtreecommitdiffstats
path: root/src/madc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/madc.cpp')
-rw-r--r--src/madc.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/madc.cpp b/src/madc.cpp
index b109448..a2c7fda 100644
--- a/src/madc.cpp
+++ b/src/madc.cpp
@@ -24,6 +24,7 @@
#include "Common/RequestManager.h"
#include "Common/Util.h"
#include "Client/CommandParser.h"
+#include "Client/InformationManager.h"
#include <iostream>
#include <cstring>
@@ -94,10 +95,23 @@ int main(int argc, char *argv[]) {
connection->sendReceive(fd.revents);
}
- std::cerr << " connected." << std::endl << std::endl;
+ std::cerr << " connected." << std::endl;
Common::RequestManager::getRequestManager()->registerConnection(connection);
+ std::cerr << "Receiving host list..." << std::flush;
+
+ Client::InformationManager::init(connection);
+
+ while(!Client::InformationManager::getInformationManager()->isInitialised()) {
+ struct pollfd fd = connection->getPollfd();
+
+ if(poll(&fd, 1, 10000) > 0)
+ connection->sendReceive(fd.revents);
+ }
+
+ std::cerr << " done." << std::endl << std::endl;
+
parser = new Mad::Client::CommandParser(connection);
parser->signalFinished().connect(sigc::ptr_fun(activateReadline));