MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / shutdown_hostnode_socket

Function shutdown_hostnode_socket

net/net.c:389–405  ·  view source on GitHub ↗

Close socket related to hostnode. */

Source from the content-addressed store, hash-verified

387
388/* Close socket related to hostnode. */
389static void shutdown_hostnode_socket(host_node_type *host_node_ptr)
390{
391 if (gbl_libevent) {
392 return;
393 }
394 if (gbl_verbose_net) {
395 host_node_printf(LOGMSG_USER, host_node_ptr, "shutting down fd %d\n",
396 host_node_ptr->fd);
397 }
398 if (shutdown(host_node_ptr->fd, 2) != 0) {
399 if (errno != ENOTCONN) {
400 host_node_errf(LOGMSG_ERROR, host_node_ptr,
401 "%s: shutdown fd %d errno %d %s\n", __func__,
402 host_node_ptr->fd, errno, strerror(errno));
403 }
404 }
405}
406
407/* This must be called while holding the host_node_ptr->lock.
408 *

Callers 2

close_hostnode_llFunction · 0.85
kill_subnetFunction · 0.85

Calls 2

host_node_printfFunction · 0.85
host_node_errfFunction · 0.85

Tested by

no test coverage detected