23,215
社区成员




while(fdManager[ind].running)
{
if(fdManager[ind].exitFlag)
{
writeLog(fd,"the main loop break now",__FILE__,__LINE__);
break;
}
ind = getFdPos(fd);
FD_ZERO (&fds);
FD_SET (fd, &fds);
/* Timeout. */
tv.tv_sec = 2;
tv.tv_usec = 0;
r = select(fd + 1, &fds, NULL, NULL, &tv);
if (-1 == r)
{
if (EINTR == errno)
writeLog(fd,"select error: -1",__FILE__,__LINE__);
}
else if (0 == r)
{
writeLog(fd,"select error: 0",__FILE__,__LINE__);
sleep(tv.tv_sec);
}
else
{
readFrame(fd,&fmt1,&bmpInfo1,p);
}
}