Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errno #254

Merged
merged 2 commits into from
Aug 12, 2021
Merged

Errno #254

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion include/ignition/transport/Discovery.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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<const raw_type *>(
reinterpret_cast<const unsigned char*>(buffer)),
Expand All @@ -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;
}
}
Expand Down