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?
有没有大佬能够帮忙解释一下发生了什么?
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?
有没有大佬能够帮忙解释一下发生了什么?