CSDN博客

img xueruini

connect & Interrupted System Call

发表于2004/10/5 17:30:00  1621人阅读

分类: Programming

一个字,太牛了! 以前用的好好的一个socket程序,今天频繁的出错,连接失败,用perror查看发现是Interrupter System call!这是怎么回事?然后google第一篇就是Unix connect & Interrupted system call,里面一看,我靠,简直没法说了!而且还有超强的Richard Steven! 把这段代码留下来保存: /* Start with fd just returned by socket(), blocking, SOCK_STREAM... */ while ( connect (fd, &name, namelen) == -1 && errno != EISCONN ) if ( errno != EINTR ) { perror ("connect"); exit (EXIT_FAILURE); } /* At this point, fd is connected. */
阅读全文
0 0

相关文章推荐

img
取 消
img