?? read-from-nag.c
字號(hào):
#include <errno.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/time.h>#include <unistd.h>#include <time.h>#include <fcntl.h>#include <sys/stat.h>#include <sys/types.h>#include <glib.h>#include "libbionet-internal.h"#include "bionet.h"// FIXME: should return errors to the callervoid bionet_read_from_nag(void) { if (bionet_connect_to_nag() < 0) { return; } do { xmlDoc *xml; int r; struct timeval timeout; timeout.tv_sec = 0; timeout.tv_usec = 0; r = bionet_nxio_read(libbionet_nag_nxio, &timeout, &xml); switch (r) { case NXIO_CLOSE: { g_log(BIONET_LOG_DOMAIN, G_LOG_LEVEL_WARNING, "error reading from NAG"); libbionet_kill_nag_connection(); return; } case NXIO_INVALID_XML: { g_log(BIONET_LOG_DOMAIN, G_LOG_LEVEL_WARNING, "read invalid reply from NAG"); libbionet_kill_nag_connection(); return; } } if (xml == NULL) { // nothing from the NAG return; } libbionet_queued_messages_from_nag = g_slist_append(libbionet_queued_messages_from_nag, xml); bionet_handle_queued_nag_messages(); } while(1);}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -