From 03668aeadaf263a9dba47d84a2f0800730187e10 Mon Sep 17 00:00:00 2001 From: zfl9 Date: Thu, 5 Mar 2020 11:20:30 +0800 Subject: use libev instead of libuv --- dnsudp2tcp.c | 19 ++++++++++++------- test | Bin 75992 -> 76040 bytes 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/dnsudp2tcp.c b/dnsudp2tcp.c index ba4c811..f5aecae 100644 --- a/dnsudp2tcp.c +++ b/dnsudp2tcp.c @@ -90,9 +90,10 @@ static char g_remote_ipstr[IP6STRLEN] = {0}; static portno_t g_remote_portno = 0; static skaddr6_t g_remote_skaddr = {0}; -static void udp_recv_cb(evloop_t *evloop, evio_t *watcher, int events); -static void tcp_send_cb(evloop_t *evloop, evio_t *watcher, int events); -static void tcp_recv_cb(evloop_t *evloop, evio_t *watcher, int events); +static void udp_recvmsg_cb(evloop_t *evloop, evio_t *watcher, int events); +static void tcp_connect_cb(evloop_t *evloop, evio_t *watcher, int events); +static void tcp_sendmsg_cb(evloop_t *evloop, evio_t *watcher, int events); +static void tcp_recvmsg_cb(evloop_t *evloop, evio_t *watcher, int events); static void set_nonblock(int sockfd) { int flags = fcntl(sockfd, F_GETFL, 0); @@ -363,21 +364,25 @@ int main(int argc, char *argv[]) { return errno; } - ev_io_init(&g_udp_watcher, udp_recv_cb, sockfd, EV_READ); + ev_io_init(&g_udp_watcher, udp_recvmsg_cb, sockfd, EV_READ); ev_io_start(g_event_loop, &g_udp_watcher); ev_run(g_event_loop, 0); return 0; } -static void udp_recv_cb(evloop_t *evloop, evio_t *watcher, int events) { +static void udp_recvmsg_cb(evloop_t *evloop, evio_t *watcher, int events) { // TODO } -static void tcp_send_cb(evloop_t *evloop, evio_t *watcher, int events) { +static void tcp_connect_cb(evloop_t *evloop, evio_t *watcher, int events) { // TODO } -static void tcp_recv_cb(evloop_t *evloop, evio_t *watcher, int events) { +static void tcp_sendmsg_cb(evloop_t *evloop, evio_t *watcher, int events) { + // TODO +} + +static void tcp_recvmsg_cb(evloop_t *evloop, evio_t *watcher, int events) { // TODO } diff --git a/test b/test index dc25767..0c4ea00 100755 Binary files a/test and b/test differ -- cgit v1.2.3