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

Method KqueueAddObj

adapter/micro_thread/kqueue_proxy.cpp:313–338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

311}
312
313bool KqueueProxy::KqueueAddObj(KqueuerObj* obj)
314{
315 if (obj == NULL)
316 {
317 MTLOG_ERROR("kqobj input invalid, %p", obj);
318 return false;
319 }
320
321 KqFdRef* item = KqFdRefGet(obj->GetOsfd());
322 if (item == NULL)
323 {
324 MT_ATTR_API(320851, 1); // fd error
325 MTLOG_ERROR("kqfd ref not find, failed, fd: %d", obj->GetOsfd());
326 kqueue_assert(0);
327 return false;
328 }
329
330 int ret = obj->KqueueCtlAdd(item);
331 if (ret < 0) {
332 MTLOG_ERROR("kqueue ctrl callback failed, fd: %d, obj: %p", obj->GetOsfd(), obj);
333 kqueue_assert(0);
334 return false;
335 }
336
337 return true;
338}
339
340bool KqueueProxy::KqueueDelObj(KqueuerObj* obj)
341{

Callers 2

CreateSockMethod · 0.80
IdleAttachMethod · 0.80

Calls 2

GetOsfdMethod · 0.80
KqueueCtlAddMethod · 0.45

Tested by

no test coverage detected