?? kill-nag-connection.c
字號(hào):
#include <errno.h>#include <string.h>#include <unistd.h>#include <sys/socket.h>#include <glib.h>#include "libbionet-internal.h"#include "bionet.h"void libbionet_kill_nag_connection(void) { int it_worked = 1; bionet_nxio_reset(libbionet_nag_nxio); if (libbionet_nag_nxio->socket < 0) return; // for the half-close scenario if (shutdown(libbionet_nag_nxio->socket, 2) != 0) { it_worked = 0; if (errno != ENOTCONN) { g_log( BIONET_LOG_DOMAIN, G_LOG_LEVEL_WARNING, "libbionet_kill_nag_connection(): error shutting down socket file descriptor: %s", strerror(errno) ); } } if (close(libbionet_nag_nxio->socket) != 0) { it_worked = 0; g_log( BIONET_LOG_DOMAIN, G_LOG_LEVEL_WARNING, "libbionet_kill_nag_connection(): error closing socket file descriptor: %s", strerror(errno) ); } if (it_worked) g_log(BIONET_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "libbionet_kill_nag_connection(): successfully terminated connection to NAG"); libbionet_nag_nxio->socket = -1;}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -