fnet.c

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

commit 8776c24643f71b82ad07284d0fe54075b6af5ed7
parent 3748ecc088d23ae613b08a9658646557396f075c
Author: Yersa Nordman <yersa@finwo.nl>
Date:   Mon, 23 Oct 2023 21:20:12 +0200

Use closesocket on windows

Diffstat:
Msrc/fnet.c | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/fnet.c b/src/fnet.c @@ -616,7 +616,11 @@ FNET_RETURNCODE fnet_close(const struct fnet_t *connection) { if (conn->nfds) { for ( i = 0 ; i < conn->nfds ; i++ ) { if ((epfd) && (conn->epev[i])) epoll_ctl(epfd, EPOLL_CTL_DEL, conn->fds[i], conn->epev[i]); +#if defined(_WIN32) || defined(_WIN64) + closesocket(conn->fds[i]); +#else close(conn->fds[i]); +#endif } conn->nfds = 0; free(conn->fds);