ChinaUnix.net
相关文章推荐:

select函数用法

表头文件 #i nclude #i nclude #i nclude 定义函数 int select(int n,fd_set * readfds,fd_set * writefds,fd_set * exceptfds,struct timeval * timeout); 函数说明 select()用来等待文件描述词状态的改变。参数n代表最大的文件描述词加1,参数readfds、writefds 和exceptfds 称为描述词组,是用来回传该描述词的读,写或例外的状况。底下的宏提供了处理这三种描述词组的方式: FD_CLR(inr fd,fd_set* set);用来清除描述词组...

by ubuntuer - Linux文档专区 - 2009-02-24 11:35:41 阅读(688) 回复(0)

相关讨论

(转)select系统调用是用来让我们的程序监视多个文件句柄(file descrīptor)的状态变化的。程序会停在select这里等待,直到被监视的文件句柄有某一个或多个发生了状态改变。 文件在句柄在 [color="#0000ff"]Linux 里 很多,如果你man某个函数,在函数返回值部分说到成功后有一个文件句柄被创建的都是的,如man socket可以看到“On success, a file descrīptor for the new socket is returned.”而man 2 open可以看到“open...

by ljp416 - Linux文档专区 - 2009-05-14 22:19:49 阅读(1196) 回复(0)

select函数用法 (转)select系统调用是用来让我们的程序监视多个文件句柄(file descrīptor)的状态变化的。程序会停在select这里等待,直到被监视的文件句柄有某一个或多个发生了状态改变。 文件在句柄在 Linux 里很多,如果你man某个函数,在函数返回值部分说到成功后有一个文件句柄被创建的都是的,如man socket可以看到“On success, a file descrīptor for the new socket is returned.”而man 2 open可以看到“open...

by 石头J - Linux文档专区 - 2009-05-22 20:04:33 阅读(826) 回复(0)

timeval t; if (select(0,NULL,NULL,NULL,&t)>;0) { //这个地方即使有输入也执行不到。 } 应该怎么写?

by 老玉米 - C/C++ - 2003-02-20 15:45:15 阅读(1636) 回复(4)

表头文件 #include #include #include 定义函数 int select(int n,fd_set * readfds,fd_set * writefds,fd_set * exceptfds,struct timeval * timeout); 函数说明 select()用来等待文件描述词状态的改变。参数n代表最大的文件描述词加1,参数readfds、writefds 和exceptfds 称为描述词组,是用来回传该描述词的读,写或例外的状况。底下的宏提供了处理这三种描述词组的方式: FD_CLR(inr fd,fd_set* set);用来清除描述词组se...

by songlin226 - Linux文档专区 - 2008-03-06 10:16:38 阅读(658) 回复(0)

select(I/O多工机制) 表头文件 #i nclude #i nclude #i nclude 定义函数 int select(int n,fd_set * readfds,fd_set * writefds,fd_set * exceptfds,struct timeval * timeout); 函数说明 select()用来等待文件描述词状态的改变。参数n代表最大的文件描述词加1,参数readfds、writefds 和exceptfds 称为描述词组,是用来回传该描述词的读,写或例外的状况。底下的宏提供了处理这三种描述词组的方式: FD_CLR(inr fd,fd_set*...

by laoyangtou - Linux文档专区 - 2007-11-05 12:10:51 阅读(615) 回复(0)

以前我编写socket程序,都是用的阻塞的方法,刚看了一篇文章,学会了select在udp服务器中的用法,但是TCP服务器中我该如何用呢,谁能告诉我一个框架啊,谢谢. accept是阻塞的,我必须得在accept之间调用select?

by luojiafeng1984 - C/C++ - 2007-03-08 15:43:24 阅读(4497) 回复(2)

select系统调用是用来让我们的程序监视多个文件句柄(file descriptor)的状态变化的。程序会停在select这里等待,直到被监视的文件句柄有某一个或多个发生了状态改变。 文 件在句柄在Linux里很多,如果你man某个函数,在函数返回值部分说到成功后有一个文件句柄被创建的都是的,如man socket可以看到“On success, a file descriptor for the new socket is returned.”而man 2 open可以看到“open() and creat() return the ne...

by songlin226 - Linux文档专区 - 2008-03-04 14:06:30 阅读(1052) 回复(0)

fd_set 设置的监听是谁? select选择的是谁 ? 最大监听是多少? 轮询监听有没有错误?

by a174787252 - 网络技术 - 2013-05-17 18:23:48 阅读(874) 回复(0)

下面一段代码 void do_sleep (int i, int loop) { int val = (i * i + 7 * i + loop) % SLEEP_BUFS; struct timeval tv; val = sleepbuf[val]; tv.tv_sec = 0; tv.tv_usec = val; select(0, NULL, NULL, NULL, &tv); } 这里的select()函数是起sleep作用吗,第一回见,请教各位 不知道发到哪个版。。。发到这里了

by kitiz - 内核源码 - 2011-07-07 18:36:09 阅读(2190) 回复(2)

xxx 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/69832/showart_1924838.html

by hubo214 - Linux文档专区 - 2009-05-11 23:07:37 阅读(650) 回复(0)