Skip to content

Commit

Permalink
Fix 'sendto()' failure on a connected UDP socket.
Browse files Browse the repository at this point in the history
  • Loading branch information
Barenboim committed Jul 28, 2024
1 parent 557b515 commit 3e8f571
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/kernel/Communicator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,13 @@ int CommMessageIn::feedback(const void *buf, size_t size)

if (!entry->ssl)
{
entry->target->get_addr(&addr, &addrlen);
return sendto(entry->sockfd, buf, size, 0, addr, addrlen);
if (entry->service)
{
entry->target->get_addr(&addr, &addrlen);
return sendto(entry->sockfd, buf, size, 0, addr, addrlen);
}
else
return write(entry->sockfd, buf, size);
}

if (size == 0)
Expand Down

0 comments on commit 3e8f571

Please sign in to comment.