From c9a0accf145e403496ad84729a10735ef79f55de Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 27 Aug 2009 03:54:43 +0200 Subject: mad, madc: Verbindungen schon vor dem Verbinden registrieren --- src/mad.cpp | 4 ++-- src/madc.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mad.cpp b/src/mad.cpp index 137328a..81061ca 100644 --- a/src/mad.cpp +++ b/src/mad.cpp @@ -47,13 +47,13 @@ int main() { Common::ClientConnection *connection = new Common::ClientConnection(&application); try { + application.getRequestManager()->registerConnection(connection); + connection->connect(boost::asio::ip::tcp::endpoint( boost::asio::ip::address_v4::from_string("127.0.0.1"), 6666)); connection->waitWhileConnecting(); - application.getRequestManager()->registerConnection(connection); - boost::shared_ptr networkLogger(new Daemon::Backends::NetworkLogger(&application, connection)); application.getLogManager()->registerLogger(networkLogger); diff --git a/src/madc.cpp b/src/madc.cpp index 23a9e45..5f6039d 100644 --- a/src/madc.cpp +++ b/src/madc.cpp @@ -63,14 +63,14 @@ int main(int argc, char *argv[]) { Common::ClientConnection *connection = new Common::ClientConnection(&application); try { + application.getRequestManager()->registerConnection(connection); + connection->connect(boost::asio::ip::tcp::endpoint(boost::asio::ip::address::from_string(argv[1]), 6666)); std::cerr << "Connecting to " << argv[1] << "..." << std::flush; connection->waitWhileConnecting(); - application.getRequestManager()->registerConnection(connection); - std::cerr << " connected." << std::endl << std::endl; { -- cgit v1.2.3