aisk / libae Goto Github PK
View Code? Open in Web Editor NEWredis's async event loop library
License: BSD 3-Clause "New" or "Revised" License
redis's async event loop library
License: BSD 3-Clause "New" or "Revised" License
samuel@localhost:~/src/libae$ make
cc -c -std=c99 -g -O0 -Wno-parentheses -Wno-switch-enum -Wno-unused-value src/anet.c -o src/anet.o
src/anet.c: In function ‘anetGenericResolve’:
src/anet.c:178:21: error: storage size of ‘hints’ isn’t known
struct addrinfo hints, *info;
^
src/anet.c:182:48: error: ‘AI_NUMERICHOST’ undeclared (first use in this function)
if (flags & ANET_IP_ONLY) hints.ai_flags = AI_NUMERICHOST;
when the select function blocked, if i want send a request how can i interrupt the block ? thanks.
I'm trying to add libae in a C++ project, using CMAKE
But, the ae_epoll.c (as well as evport, kqueue, select) header files are causing some issues in the make:
My CMAKE:
cmake_minimum_required(VERSION 3.17)
project(dynbe)
set(CMAKE_CXX_STANDARD 14)
set(libae "src/libae/ae.h" "src/libae/ae.c" "src/libae/anet.h" "src/libae/anet.c"
"src/libae/ae_evport.c" "src/libae/ae_epoll.c" "src/libae/ae_kqueue.c"
"src/libae/ae_select.c" "src/libae/config.h" "src/libae/fmacros.h"
"src/libae/zmalloc.h")
add_library(ae STATIC ${libae})
add_executable(dynbe main.cpp src/libs/SingleBehavior.h src/libs/EchoServer.h
src/Behavior.h src/FdEventProc.h)
target_link_libraries(dynbe ae)
Error I get when CMAKE
/home/ubung/C_C++/C++/dynbe/src/libae/ae_evport.c:33:10: fatal error: port.h: No such file or directory
#include <port.h>
^~~~~~~~
compilation terminated.
CMakeFiles/ae.dir/build.make:108: recipe for target 'CMakeFiles/ae.dir/src/libae/ae_evport.c.o' failed
make[2]: *** [CMakeFiles/ae.dir/src/libae/ae_evport.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/ubung/C_C++/C++/dynbe/src/libae/ae_kqueue.c:33:10: fatal error: sys/event.h: No such file or directory
#include <sys/event.h>
^~~~~~~~~~~~~
compilation terminated.
CMakeFiles/ae.dir/build.make:134: recipe for target 'CMakeFiles/ae.dir/src/libae/ae_kqueue.c.o' failed
make[2]: *** [CMakeFiles/ae.dir/src/libae/ae_kqueue.c.o] Error 1
/home/ubung/C_C++/C++/dynbe/src/libae/ae_select.c:42:24: error: unknown type name ‘aeEventLoop’
static int aeApiCreate(aeEventLoop *eventLoop) {
^~~~~~~~~~~
/home/ubung/C_C++/C++/dynbe/src/libae/ae_select.c:52:24: error: unknown type name ‘aeEventLoop’
static int aeApiResize(aeEventLoop *eventLoop, int setsize) {
^~~~~~~~~~~
/home/ubung/C_C++/C++/dynbe/src/libae/ae_select.c:58:23: error: unknown type name ‘aeEventLoop’
static void aeApiFree(aeEventLoop *eventLoop) {
^~~~~~~~~~~
/home/ubung/C_C++/C++/dynbe/src/libae/ae_select.c:62:26: error: unknown type name ‘aeEventLoop’
static int aeApiAddEvent(aeEventLoop *eventLoop, int fd, int mask) {
^~~~~~~~~~~
/home/ubung/C_C++/C++/dynbe/src/libae/ae_select.c:70:27: error: unknown type name ‘aeEventLoop’
static void aeApiDelEvent(aeEventLoop *eventLoop, int fd, int mask) {
^~~~~~~~~~~
/home/ubung/C_C++/C++/dynbe/src/libae/ae_epoll.c:38:24: error: unknown type name ‘aeEventLoop’
static int aeApiCreate(aeEventLoop *eventLoop) {
^~~~~~~~~~~
/home/ubung/C_C++/C++/dynbe/src/libae/ae_select.c:77:22: error: unknown type name ‘aeEventLoop’
static int aeApiPoll(aeEventLoop *eventLoop, struct timeval *tvp) {
^~~~~~~~~~~
/home/ubung/C_C++/C++/dynbe/src/libae/ae_epoll.c:57:24: error: unknown type name ‘aeEventLoop’
static int aeApiResize(aeEventLoop *eventLoop, int setsize) {
^~~~~~~~~~~
/home/ubung/C_C++/C++/dynbe/src/libae/ae_epoll.c:64:23: error: unknown type name ‘aeEventLoop’
static void aeApiFree(aeEventLoop *eventLoop) {
^~~~~~~~~~~
/home/ubung/C_C++/C++/dynbe/src/libae/ae_epoll.c:72:26: error: unknown type name ‘aeEventLoop’
static int aeApiAddEvent(aeEventLoop *eventLoop, int fd, int mask) {
^~~~~~~~~~~
CMakeFiles/ae.dir/build.make:147: recipe for target 'CMakeFiles/ae.dir/src/libae/ae_select.c.o' failed
make[2]: *** [CMakeFiles/ae.dir/src/libae/ae_select.c.o] Error 1
/home/ubung/C_C++/C++/dynbe/src/libae/ae_epoll.c:89:27: error: unknown type name ‘aeEventLoop’
static void aeApiDelEvent(aeEventLoop *eventLoop, int fd, int delmask) {
^~~~~~~~~~~
/home/ubung/C_C++/C++/dynbe/src/libae/ae_epoll.c:107:22: error: unknown type name ‘aeEventLoop’
static int aeApiPoll(aeEventLoop *eventLoop, struct timeval *tvp) {
^~~~~~~~~~~
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.