Commit cf671374 authored by Volodymyr Yurchenko's avatar Volodymyr Yurchenko
Browse files

Print a message while connecting to JCentral

parent 67578530
......@@ -2,6 +2,7 @@
// Author: Volodymyr Yurchenko 27/06/2019
#include "TJAlienConnectionManager.h"
#include <iostream>
ClassImp(TJAlienConnectionManager)
......@@ -54,13 +55,16 @@ int TJAlienConnectionManager::CreateConnection()
return 0;
}
std::cout << "\r" << "Opening connection to JCentral. Please wait" << std::flush;
for (int i = 0; i < dns_jcentral.lenght(); i++)
{
std::cout << "." << std::flush;
current_host = dns_jcentral.get_next_host();
ConnectJCentral(co, current_host);
if (connection_flag)
{
std::cout << "\r" << std::flush;
Info("TJAlienConnectionManager", "Successfully connected to %s", current_host.c_str());
co.password = "";
fWSHost = default_server;
......@@ -72,6 +76,7 @@ int TJAlienConnectionManager::CreateConnection()
else
{
if (gDebug > 0) {
std::cout << "\r" << std::flush;
Error("TJAlienConnectionManager", "Failed to connect to %s - retrying...", current_host.c_str());
}
sleep(1);
......@@ -79,6 +84,7 @@ int TJAlienConnectionManager::CreateConnection()
}
creds.removeCredentials(co.kind);
}
std::cout << "\r" << std::flush;
Error("TJAlienConnectionManager", "Failed to connect to any server! Giving up");
return -1;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment