diff options
author | Kevin Smith <git@kismith.co.uk> | 2010-03-30 14:57:00 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2010-03-30 14:57:00 (GMT) |
commit | 03a5a0a4a6c7504acead164dc8334c36da86a888 (patch) | |
tree | 5d6505a535e031c64c55324a26eb48c34dcfd470 | |
parent | f5cb5e389a5720247d81e48d3e404a3311a538cb (diff) | |
download | swift-03a5a0a4a6c7504acead164dc8334c36da86a888.zip swift-03a5a0a4a6c7504acead164dc8334c36da86a888.tar.bz2 |
Announce the timeout settings the connectivity test example uses
-rw-r--r-- | Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp b/Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp index 09d9cd6..f48eb2b 100644 --- a/Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp +++ b/Swiften/Examples/ConnectivityTest/ConnectivityTest.cpp @@ -64,17 +64,21 @@ int main(int argc, char* argv[]) { client = new Swift::Client(JID(jid), String(argv[argi++])); char* timeoutChar = argv[argi++]; int timeout = atoi(timeoutChar); + timeout = (timeout ? timeout : 30) * 1000; ClientXMLTracer* tracer = new ClientXMLTracer(client); client->onConnected.connect(&handleConnected); errorConnection = client->onError.connect(&handleError); + std::cout << "Connecting to JID " << jid << " with timeout " << timeout << "ms on host: "; ; if (!connectHost.isEmpty()) { + std::cout << connectHost << std::endl; client->connect(connectHost); } else { + std::cout << " Default" << std::endl; client->connect(); } { - boost::shared_ptr<BoostTimer> timer(new BoostTimer((timeout ? timeout : 30) * 1000, &MainBoostIOServiceThread::getInstance().getIOService())); + boost::shared_ptr<BoostTimer> timer(new BoostTimer(timeout, &MainBoostIOServiceThread::getInstance().getIOService())); timer->onTick.connect(boost::bind(&SimpleEventLoop::stop, &eventLoop)); timer->start(); |