int flags = fcntl(m_sockets[iIndex], F_GETFL, 0); //获取建立的sockfd的当前状态
(void)fcntl(m_sockets[iIndex], F_SETFL, flags | O_NONBLOCK); //将当前sockfd设置为非阻塞
设置非阻塞
最新推荐文章于 2023-11-30 20:54:08 发布
int flags = fcntl(m_sockets[iIndex], F_GETFL, 0); //获取建立的sockfd的当前状态
(void)fcntl(m_sockets[iIndex], F_SETFL, flags | O_NONBLOCK); //将当前sockfd设置为非阻塞