Commit f14479c7 authored by antirez's avatar antirez
Browse files

new ae.c API to get current events by file descriptor.

parent 491c1c4e
...@@ -118,6 +118,13 @@ void aeDeleteFileEvent(aeEventLoop *eventLoop, int fd, int mask) ...@@ -118,6 +118,13 @@ void aeDeleteFileEvent(aeEventLoop *eventLoop, int fd, int mask)
aeApiDelEvent(eventLoop, fd, mask); aeApiDelEvent(eventLoop, fd, mask);
} }
int aeGetFileEvents(aeEventLoop *eventLoop, int fd) {
if (fd >= AE_SETSIZE) return 0;
aeFileEvent *fe = &eventLoop->events[fd];
return fe->mask;
}
static void aeGetTime(long *seconds, long *milliseconds) static void aeGetTime(long *seconds, long *milliseconds)
{ {
struct timeval tv; struct timeval tv;
......
...@@ -104,6 +104,7 @@ void aeStop(aeEventLoop *eventLoop); ...@@ -104,6 +104,7 @@ void aeStop(aeEventLoop *eventLoop);
int aeCreateFileEvent(aeEventLoop *eventLoop, int fd, int mask, int aeCreateFileEvent(aeEventLoop *eventLoop, int fd, int mask,
aeFileProc *proc, void *clientData); aeFileProc *proc, void *clientData);
void aeDeleteFileEvent(aeEventLoop *eventLoop, int fd, int mask); void aeDeleteFileEvent(aeEventLoop *eventLoop, int fd, int mask);
int aeGetFileEvents(aeEventLoop *eventLoop, int fd);
long long aeCreateTimeEvent(aeEventLoop *eventLoop, long long milliseconds, long long aeCreateTimeEvent(aeEventLoop *eventLoop, long long milliseconds,
aeTimeProc *proc, void *clientData, aeTimeProc *proc, void *clientData,
aeEventFinalizerProc *finalizerProc); aeEventFinalizerProc *finalizerProc);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment