Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
f14479c7
Commit
f14479c7
authored
Nov 21, 2011
by
antirez
Browse files
new ae.c API to get current events by file descriptor.
parent
491c1c4e
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/ae.c
View file @
f14479c7
...
...
@@ -118,6 +118,13 @@ void aeDeleteFileEvent(aeEventLoop *eventLoop, int fd, int 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
)
{
struct
timeval
tv
;
...
...
src/ae.h
View file @
f14479c7
...
...
@@ -104,6 +104,7 @@ void aeStop(aeEventLoop *eventLoop);
int
aeCreateFileEvent
(
aeEventLoop
*
eventLoop
,
int
fd
,
int
mask
,
aeFileProc
*
proc
,
void
*
clientData
);
void
aeDeleteFileEvent
(
aeEventLoop
*
eventLoop
,
int
fd
,
int
mask
);
int
aeGetFileEvents
(
aeEventLoop
*
eventLoop
,
int
fd
);
long
long
aeCreateTimeEvent
(
aeEventLoop
*
eventLoop
,
long
long
milliseconds
,
aeTimeProc
*
proc
,
void
*
clientData
,
aeEventFinalizerProc
*
finalizerProc
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment