MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / aeCreateFileEvent

Function aeCreateFileEvent

src/ae.cpp:427–447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

425}
426
427extern "C" int aeCreateFileEvent(aeEventLoop *eventLoop, int fd, int mask,
428 aeFileProc *proc, void *clientData)
429{
430 serverAssert(g_eventLoopThisThread == NULL || g_eventLoopThisThread == eventLoop);
431 if (fd >= eventLoop->setsize) {
432 errno = ERANGE;
433 return AE_ERR;
434 }
435
436 aeFileEvent *fe = &eventLoop->events[fd];
437
438 if (aeApiAddEvent(eventLoop, fd, mask) == -1)
439 return AE_ERR;
440 fe->mask |= mask;
441 if (mask & AE_READABLE) fe->rfileProc = proc;
442 if (mask & AE_WRITABLE) fe->wfileProc = proc;
443 fe->clientData = clientData;
444 if (fd > eventLoop->maxfd)
445 eventLoop->maxfd = fd;
446 return AE_OK;
447}
448
449void aeDeleteFileEventAsync(aeEventLoop *eventLoop, int fd, int mask)
450{

Callers 15

rdbSaveToSlavesSocketsFunction · 0.85
connSocketConnectFunction · 0.85
connSocketSetReadHandlerFunction · 0.85
aeProcessCmdFunction · 0.85
aeCreateRemoteFileEventFunction · 0.85
aeCreateEventLoopFunction · 0.85
resetClientFunction · 0.85
writeHandlerFunction · 0.85
createClientFunction · 0.85
resetClientFunction · 0.85
writeHandlerFunction · 0.85

Calls 1

aeApiAddEventFunction · 0.70

Tested by

no test coverage detected