Skip to content
This repository has been archived by the owner on Jul 8, 2022. It is now read-only.

Commit

Permalink
Merge pull request #716 from bourtemb/fix-nb_endpoints-connect_event_…
Browse files Browse the repository at this point in the history
…channel-9.3

Fix nb_endpoints in ZmqEventConsumer::connect_event_channel
  • Loading branch information
t-b authored May 28, 2020
2 parents cd4abdd + 11ca194 commit 4f8a0ba
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions cppapi/client/zmqeventconsumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1294,21 +1294,29 @@ void ZmqEventConsumer::connect_event_channel(string &channel_name,TANGO_UNUSED(D
// If the server has returned several possible ZMQ endpoints (because several NIC boards on server host), check which
// one is correct
//
size_t nb_endpoints = ev_svr_data->svalue.length();

size_t nb_endpoint = ev_svr_data->svalue.length();
nb_endpoint = nb_endpoint >> 1;
Tango::DevLong server_tango_lib_version = ev_svr_data->lvalue[0];
if(server_tango_lib_version >= 930)
{
// ZmqEventSubscriptionChange returns the ZMQ message filters used for the attribute
// and for the heartbeat events at the end of the string array part of the returned DevVarLongStringArray
nb_endpoints -= 2;
}

nb_endpoints = nb_endpoints >> 1;
size_t valid_endpoint = 0;

if (nb_endpoint != 1)
if (nb_endpoints != 1)
{
for (valid_endpoint = 0;valid_endpoint < nb_endpoint;valid_endpoint++)
for (valid_endpoint = 0; valid_endpoint < nb_endpoints; valid_endpoint++)
{
string endpoint(ev_svr_data->svalue[valid_endpoint << 1]);
if (check_zmq_endpoint(endpoint) == true)
break;
}

if (valid_endpoint == nb_endpoint)
if (valid_endpoint == nb_endpoints)
{
stringstream o;

Expand Down

0 comments on commit 4f8a0ba

Please sign in to comment.