学习笔记:openwrt listen & send 合并在同一个进程准备用于IPC源码(epoll_fd 在 send event 完成后关闭导致listen终止的问题)
关键代码:ctx_send->sock.registered = true;
源码:
listen.c
#include <stdio.h>
#include <sys/time.h>
#include <unistd.h>
#include <libubox/ustream.h>
#include <libubox/blobmsg_json.h>
#include <pthread.h>
#include "libubus.h"
static struct ubus_context *ctx_listen = NULL;
static struct ubus_context *ctx_send = NULL;