[DEV] correct launch in gateway of service and correct the test client API
This commit is contained in:
parent
4df96d11ce
commit
22c82ecc49
@ -317,12 +317,23 @@ int main(int _argc, const char *_argv[]) {
|
|||||||
elog::init(_argc, _argv);
|
elog::init(_argc, _argv);
|
||||||
zeus::init(_argc, _argv);
|
zeus::init(_argc, _argv);
|
||||||
zeus::Client client1;
|
zeus::Client client1;
|
||||||
|
std::string fromUser = "test1";
|
||||||
|
std::string toUser = "test1";
|
||||||
|
std::string pass = "coucou";
|
||||||
for (int32_t iii=0; iii<_argc ; ++iii) {
|
for (int32_t iii=0; iii<_argc ; ++iii) {
|
||||||
std::string data = _argv[iii];
|
std::string data = _argv[iii];
|
||||||
if (etk::start_with(data, "--ip=") == true) {
|
if (etk::start_with(data, "--ip=") == true) {
|
||||||
client1.propertyIp.set(std::string(&data[5]));
|
client1.propertyIp.set(std::string(&data[5]));
|
||||||
} else if (etk::start_with(data, "--port=") == true) {
|
} else if (etk::start_with(data, "--port=") == true) {
|
||||||
client1.propertyPort.set(etk::string_to_uint16_t(std::string(&data[7])));
|
client1.propertyPort.set(etk::string_to_uint16_t(std::string(&data[7])));
|
||||||
|
} else if (etk::start_with(data, "--from=") == true) {
|
||||||
|
fromUser = &data[7];
|
||||||
|
} else if (etk::start_with(data, "--to=") == true) {
|
||||||
|
toUser = &data[7];
|
||||||
|
} else if (etk::start_with(data, "--pass=") == true) {
|
||||||
|
pass = &data[7];
|
||||||
|
} else if (etk::start_with(data, "--tocken=") == true) {
|
||||||
|
pass = &data[9];
|
||||||
} else if ( data == "-h"
|
} else if ( data == "-h"
|
||||||
|| data == "--help") {
|
|| data == "--help") {
|
||||||
APPL_PRINT(etk::getApplicationName() << " - help : ");
|
APPL_PRINT(etk::getApplicationName() << " - help : ");
|
||||||
@ -336,29 +347,29 @@ int main(int _argc, const char *_argv[]) {
|
|||||||
APPL_INFO("== ZEUS test client start ==");
|
APPL_INFO("== ZEUS test client start ==");
|
||||||
APPL_INFO("==================================");
|
APPL_INFO("==================================");
|
||||||
|
|
||||||
if (false) {
|
if (fromUser == toUser) {
|
||||||
bool ret = client1.connect("test1", "clientTest1~atria-soft.com", "QSDQSDGQSF54HSXWVCSQDJ654URTDJ654NBXCDFDGAEZ51968");
|
bool ret = client1.connect(fromUser, pass);
|
||||||
if (ret == false) {
|
if (ret == false) {
|
||||||
APPL_ERROR(" ==> NOT Connected to 'test1~atria-soft.com' with 'clientTest1~atria-soft.com'");
|
APPL_ERROR(" ==> NOT Authentify with '" << toUser << "'");
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
APPL_INFO(" ==> Connected with 'clientTest1~atria-soft.com'");
|
APPL_INFO(" ==> Authentify with '" << toUser << "'");
|
||||||
}
|
}
|
||||||
} else if (true) {
|
} else if (fromUser != "") {
|
||||||
bool ret = client1.connect("test1", "coucou");
|
bool ret = client1.connect(fromUser, toUser, pass);
|
||||||
if (ret == false) {
|
if (ret == false) {
|
||||||
APPL_ERROR(" ==> NOT Authentify with 'test1~atria-soft.com'");
|
APPL_ERROR(" ==> NOT Connected to '" << toUser << "' with '" << fromUser << "'");
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
APPL_INFO(" ==> Authentify with 'test1~atria-soft.com'");
|
APPL_INFO(" ==> Connected with '" << toUser << "'");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
bool ret = client1.connect("test1");
|
bool ret = client1.connect(toUser);
|
||||||
if (ret == false) {
|
if (ret == false) {
|
||||||
APPL_ERROR(" ==> NOT Connected with 'anonymous'");
|
APPL_ERROR(" ==> NOT Connected with 'anonymous' to '" << toUser << "'");
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
APPL_INFO(" ==> Connected with 'anonymous'");
|
APPL_INFO(" ==> Connected with 'anonymous' to '" << toUser << "'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Connect to ourself:
|
// Connect to ourself:
|
||||||
|
@ -40,7 +40,6 @@ class PlugginAccess {
|
|||||||
SERVICE_IO_uninit_t m_SERVICE_IO_uninit;
|
SERVICE_IO_uninit_t m_SERVICE_IO_uninit;
|
||||||
SERVICE_IO_peridic_call_t m_SERVICE_IO_peridic_call;
|
SERVICE_IO_peridic_call_t m_SERVICE_IO_peridic_call;
|
||||||
SERVICE_IO_instanciate_t m_SERVICE_IO_instanciate;
|
SERVICE_IO_instanciate_t m_SERVICE_IO_instanciate;
|
||||||
zeus::Client m_client;
|
|
||||||
public:
|
public:
|
||||||
PlugginAccess(const std::string& _name) :
|
PlugginAccess(const std::string& _name) :
|
||||||
m_name(_name),
|
m_name(_name),
|
||||||
@ -132,6 +131,8 @@ int main(int _argc, const char *_argv[]) {
|
|||||||
std::string basePath;
|
std::string basePath;
|
||||||
std::vector<std::string> services;
|
std::vector<std::string> services;
|
||||||
zeus::Client m_client;
|
zeus::Client m_client;
|
||||||
|
// The default service port is 1985
|
||||||
|
m_client.propertyPort.set(1985);
|
||||||
#endif
|
#endif
|
||||||
for (int32_t iii=0; iii<_argc ; ++iii) {
|
for (int32_t iii=0; iii<_argc ; ++iii) {
|
||||||
std::string data = _argv[iii];
|
std::string data = _argv[iii];
|
||||||
|
@ -32,7 +32,6 @@ class PlugginAccess {
|
|||||||
SERVICE_IO_uninit_t m_SERVICE_IO_uninit;
|
SERVICE_IO_uninit_t m_SERVICE_IO_uninit;
|
||||||
SERVICE_IO_peridic_call_t m_SERVICE_IO_peridic_call;
|
SERVICE_IO_peridic_call_t m_SERVICE_IO_peridic_call;
|
||||||
SERVICE_IO_instanciate_t m_SERVICE_IO_instanciate;
|
SERVICE_IO_instanciate_t m_SERVICE_IO_instanciate;
|
||||||
zeus::Client m_client;
|
|
||||||
public:
|
public:
|
||||||
PlugginAccess(const std::string& _name) :
|
PlugginAccess(const std::string& _name) :
|
||||||
m_name(_name),
|
m_name(_name),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user