live555的核心函数是void BasicTaskScheduler::SingleStep(unsigned maxDelayTime): 1 void BasicTaskScheduler::SingleStep(unsigned maxDelayTime) { 2 fd_set r...
分类:
其他好文 时间:
2015-01-08 17:20:38
阅读次数:
459
Linux 2.6内核中提高网络I/O性能的新方法-epoll I/O多路复用技术在比较多的TCP网络服务器中有使用,即比较多的用到select函数。1、为什么select落后 首先,在Linux内核中,select所用到的FD_SET是有限的,即内核中有个参数__FD_SETSIZE定义了每个FD...
分类:
其他好文 时间:
2014-12-25 16:06:05
阅读次数:
290
select函数用于在非阻塞中,当一个套接字或一组套接字有信号时通知你,系统提供select函数来实现多路复用输入/输出模型,原型:#include#includeintselect(intmaxfd,fd_set*rdset,fd_set*wrset,fd_set*exset,structtime...
分类:
其他好文 时间:
2014-12-12 13:04:19
阅读次数:
137
read_timeout函数封装//读超时函数,但不包含读操作
int read_timeout(int fd, long waitSec)
{
int returnValue = 0;
if (waitSec > 0)
{
fd_set readSet;
FD_ZERO(&readSet); //清零
FD_SET...
这是头文件包含顺序的问题,原因与解决办法见下面代码的注释。/*包含下面这两个头文件时,必须把winsock2.h放在前面否则编译报错,N多的重定义错误:例如 error C2011: 'fd_set' : 'struct' type redefinition*/#include #include i...
分类:
其他好文 时间:
2014-12-07 19:02:46
阅读次数:
168
Select函数Man-Page/* According to POSIX.1-2001 */
#include
/* According to earlier standards */
#include
#include
#include
int select(int nfds, fd_set *readfds, fd_set *writefds,
fd_set...
分类:
其他好文 时间:
2014-12-06 21:36:28
阅读次数:
269
select函数用于在非阻塞中,当一个套接字或一组套接字有信号时通知你,系统提供select函数来实现多路复用输入/输出模型,原型:int select(int maxfd,fd_set *rdset,fd_set *wrset,fd_set *exset,struct timeval *timeo...
分类:
其他好文 时间:
2014-11-29 10:16:34
阅读次数:
194
select函数用于在非阻塞中,当一个套接字或一组套接字有信号时通知你,系统提供select函数来实现多路复用输入/输出模型,原型:int select(int maxfd,fd_set *rdset,fd_set *wrset,fd_set *exset,struct timeval *timeo...
分类:
其他好文 时间:
2014-11-25 15:51:52
阅读次数:
203
select函数允许程序同时在多个底层文件描述符下等待输入完成,这意味着终端仿真程序可一直阻塞到有事可做为止。select系统调用原型:1 #include 2 #include 3 4 int select(int nfds, fd_set *readfds, fd_set *write...
分类:
其他好文 时间:
2014-11-22 17:15:05
阅读次数:
181
select实现精确定时器 int?select(int?nfds,?fd_set?*readfds,?fd_set?*writefds,?fd_set?*exceptfds,?struct?timeval?*timeout);
struct?timeval?{?long?tv_sec;?long?tv_usec;?}?/*?secon...
分类:
其他好文 时间:
2014-11-17 21:23:19
阅读次数:
252