8000 !ret.is_error(EAGAIN) 中 为什么需要调用return cb(ret); · Issue #4 · archibate/co_http · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
!ret.is_error(EAGAIN) 中 为什么需要调用return cb(ret); #4
Open
@gknagoing

Description

@gknagoing
function:async_accept
......
       auto ret =
           convert_error<int>(accept(m_fd, &addr.m_addr, &addr.m_addrlen));
       if (!ret.is_error(EAGAIN)) {
           stop.clear_stop_callback();
           cb(ret);//Server不会报错 和 chat_Server会报错
           //return cb(ret);//Server 和 chat_Server都不会报错
           //return;//Server会报错 和 chat_Server会报错
       }

这里为什么必须调用cb(ret) 且需要return?
有没有大佬能够帮忙解释一下发生了什么?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0