Skip to content

Commit

Permalink
Fix comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakio815 committed Jan 24, 2025
1 parent 6b8bd91 commit 1edd1e3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions include/core/federated/network/socket_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,12 @@ void write_to_socket_fail_on_error(int* socket, size_t num_bytes, unsigned char*
char* format, ...);

/**
* @brief Gracefully shuts down and closes a socket, optionally reading until EOF.
* Shutdown and close the socket. If read_before_closing is false, it just immediately calls shutdown() with SHUT_RDWR
* and close(). If read_before_closing is true, it calls shutdown with SHUT_WR, only disallowing further writing. Then,
* it calls read() until EOF is received, and discards all received bytes.
* @param socket Pointer to the socket descriptor to shutdown and close.
* @param read_before_closing If true, read until EOF before closing the socket.
* @return int Returns 0 on success, -1 on failure (errno will indicate the error).
* @return int 0 for success and -1 for an error.
*/
int shutdown_socket(int* socket, bool read_before_closing);

Expand Down

0 comments on commit 1edd1e3

Please sign in to comment.