MCPcopy Create free account
hub / github.com/F-Stack/f-stack / KqueueCtlAdd

Method KqueueCtlAdd

adapter/micro_thread/mt_notify.cpp:246–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

244}
245
246int UdpSessionNtfy::KqueueCtlAdd(void* args)
247{
248 MtFrame* frame = MtFrame::Instance();
249 KqFdRef* fd_ref = (KqFdRef*)args;
250 //ASSERT(fd_ref != NULL);
251
252 int osfd = this->GetOsfd();
253
254 KqueuerObj* old_obj = fd_ref->GetNotifyObj();
255 if ((old_obj != NULL) && (old_obj != this))
256 {
257 MTLOG_ERROR("epfd ref conflict, fd: %d, old: %p, now: %p", osfd, old_obj, this);
258 return -1;
259 }
260
261 if (!frame->KqueueCtrlAdd(osfd, KQ_EVENT_WRITE))
262 {
263 MTLOG_ERROR("epfd ref add failed, log");
264 return -2;
265 }
266 this->EnableOutput();
267
268 return 0;
269}
270
271int UdpSessionNtfy::KqueueCtlDel(void* args)
272{

Callers

nothing calls this directly

Calls 4

GetOsfdMethod · 0.80
GetNotifyObjMethod · 0.80
KqueueCtrlAddMethod · 0.80
EnableOutputMethod · 0.80

Tested by

no test coverage detected