diff --git a/include/ignition/transport/Discovery.hh b/include/ignition/transport/Discovery.hh index b673e2ad7..ff3f3f6e1 100644 --- a/include/ignition/transport/Discovery.hh +++ b/include/ignition/transport/Discovery.hh @@ -1170,6 +1170,7 @@ namespace ignition // Send the discovery message to the unicast relays. for (const auto &sockAddr : this->relayAddrs) { + errno = 0; auto sent = sendto(this->sockets.at(0), reinterpret_cast( reinterpret_cast(buffer)), @@ -1179,7 +1180,9 @@ namespace ignition if (sent != totalSize) { - std::cerr << "Exception sending a unicast message" << std::endl; + std::cerr << "Exception sending a unicast message:" << std::endl; + std::cerr << " Return value: " << sent << std::endl; + std::cerr << " Error code: " << strerror(errno) << std::endl; break; } }