现在的位置: 首页 > 综合 > 正文

select 中的描述符被外部关闭时的情况

2013年10月18日 ⁄ 综合 ⁄ 共 1435字 ⁄ 字号 评论关闭

最近在发现select(fd + 1, &readfd, &writefd, &expfd, NULL); 此时select已经进入等待状态, 然而 fd 被其他线程关闭时, select并不能及时发现,而依旧是处于等待中。

 

 

 

运行 结果 :

[root@localhost hellolinux]# ./hello

go to select

close sock

抱歉!评论已关闭.