| 244 | } |
| 245 | |
| 246 | int 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 | |
| 271 | int UdpSessionNtfy::KqueueCtlDel(void* args) |
| 272 | { |
nothing calls this directly
no test coverage detected