fnet.c

Simple C networking library
git clone git://git.finwo.net/lib/fnet.c
Log | Files | Refs | README

commit 74b3fc265dbe4fd95edaa62f00de97a40ce090d8
parent 57959fe244c4335252f430215238de9e45e342ff
Author: Yersa Nordman <yersa@finwo.nl>
Date:   Sun, 22 Oct 2023 22:36:03 +0200

Use full epoll polyfill with fallback to sys/epoll

Diffstat:
Msrc/fnet.c | 5++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/fnet.c b/src/fnet.c @@ -11,19 +11,18 @@ extern "C" { #include <sys/types.h> #if defined(_WIN32) || defined(_WIN64) -#include "piscisaureus/wepoll.h" #include <sys/timeb.h> #include <winsock2.h> #include <Ws2tcpip.h> #else #include <netdb.h> #include <netinet/tcp.h> -#include <sys/epoll.h> #include <sys/socket.h> #include <sys/time.h> #include <unistd.h> #endif +#include "piscisaureus/wepoll.h" #include "tidwall/buf.h" #include "fnet.h" @@ -45,7 +44,7 @@ struct fnet_internal_t { }; struct fnet_internal_t *connections = NULL; -int epfd = 0; +EPOLL_HANDLE epfd = 0; FNET_RETURNCODE setkeepalive(FNET_SOCKET fd) { if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &(int){1}, sizeof(int))) {