From e832465067f061525ec348042acbef5f8068f8c1 Mon Sep 17 00:00:00 2001 From: Sergi Hernandez Juan <shernand@iri.upc.edu> Date: Tue, 27 Feb 2024 13:09:01 +0100 Subject: [PATCH] Modified the name of the data events of the UDP sockets to include the port. --- src/sockets/socketudp.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sockets/socketudp.cpp b/src/sockets/socketudp.cpp index 3460612..dab58b9 100755 --- a/src/sockets/socketudp.cpp +++ b/src/sockets/socketudp.cpp @@ -198,6 +198,7 @@ std::string CSocketUDP::add_client(std::string &ip) { CEventServer *event_server=CEventServer::instance(); TUDPClient *new_client=new TUDPClient; + std::stringstream text; unsigned int i=0; for(i=0;i<this->clients.size();i++) @@ -210,7 +211,8 @@ std::string CSocketUDP::add_client(std::string &ip) } // add the new IP address to wait data for new_client->ip_address=ip; - new_client->new_data_avail_event_id=ip + "_data_avail_event_id"; + text << ip << "_" << this->associated_port << "_data_avail_event_id"; + new_client->new_data_avail_event_id=text.str(); event_server->create_event(new_client->new_data_avail_event_id); this->clients.push_back(new_client); -- GitLab