Skip to content

Commit

Permalink
Merge branch 'shutdown' of github.com:lf-lang/reactor-c into shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakio815 committed Jan 24, 2025
2 parents 0f89b4c + e93f266 commit aa6fe33
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/federated/network/socket_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,10 @@ void write_to_socket_fail_on_error(int* socket, size_t num_bytes, unsigned char*
}

int shutdown_socket(int* socket, bool read_before_closing) {
if (*socket == -1) {
lf_print_log("Socket is already closed.");
return 0;
}
if (!read_before_closing) {
if (shutdown(*socket, SHUT_RDWR)) {
lf_print_log("On shutdown socket, received reply: %s", strerror(errno));
Expand Down

0 comments on commit aa6fe33

Please sign in to comment.