| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
The event loop interface selected libevent on Windows when no Unix\nbackend applied. Replace that implicit fallback with a native\nWinSock-based backend so the core event loop no longer depends on\nlibevent for Windows builds by default.\n\nThe new backend keeps the existing mk_event interface semantics for\nreadable sockets, notification channels, timer delivery, and injected\nevents. Update the build selection logic so Windows defaults to the\nnative backend and only builds libevent when it is requested\nexplicitly.\n\nAdd unit coverage for the public event loop interface, including\nchannel notifications, add/wait/delete flow, duplicate-safe injection,\nand timeout delivery.\n\nVerified with:\n- cmake -S . -B build -DMK_TESTS=ON\n- cmake --build build\n- ./build/bin/mk-test-event_loop\n- ./build/bin/mk-test-event_timeout\n- ./build/bin/mk-test-lib_server Signed-off-by: Eduardo Silva <edsiper@gmail.com>
The native Windows event loop backend removed the libevent build\nrequirement, but mk_fifo still included event.h and used\nevutil_socketpair() on Windows. Replace that path with a native socket\npair helper so the server code builds without libevent headers.\n\nAlso update the pthread_once callback prototype in mk_server/monkey.c\nto use an explicit void parameter list, which avoids the MSVC C4113\nwarning during Windows builds.\n\nVerified with:\n- cmake --build build --target monkey-core-static\n- cmake --build build --target mk-test-lib_server\n- cmake --build build --target mk-test-event_loop\n- cmake --build build --target mk-test-event_timeout Signed-off-by: Eduardo Silva <edsiper@gmail.com>
|
|
||
| static LONG win32_wsa_initialized = 0; | ||
|
|
||
| static int win32_socketpair(SOCKET pair[2]) |
There was a problem hiding this comment.
Since Windows 10 1803, we can use AF_UNIX on Windows with including afunix.h like:
#ifdef EVENT__HAVE_AFUNIX_H
#include <afunix.h>
#endif
/* ... */
SOCKET s = socket(AF_UNIX, SOCK_STREAM, 0);
struct sockaddr_un addr;
addr.sun_family = AF_UNIX;
strcpy_s(addr.sun_path, sizeof(addr.sun_path), "C:\\Temp\\xxx.sock");For further information, we can refer the following links:
https://devblogs.microsoft.com/commandline/af_unix-comes-to-windows/
Sorry, something went wrong.
There was a problem hiding this comment.
Or, we can include this type of changes in libevent to monkey event system:
libevent/libevent#913
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Tests Added
Added unit coverage for the public event loop interface, including:
Verification
cmake -S . -B build -DMK_TESTS=ON
cmake --build build
./build/bin/mk-test-event_loop
./build/bin/mk-test-event_timeout
./build/bin/mk-test-lib_server