摘要: 1 #define POLL_FD_SIZE 1024 2 int doServicePoll(int listenFd) 3 { 4 struct sockaddr_in cliAddr; 5 socklen_t len; 6 7 int i; 8 struct pollfd pollFdSet[POLL_FD_SIZE]; 9 for(i = 0 ; i fdNum) {41 fdNum = i;42 }43 ... 阅读全文
posted @ 2014-03-16 23:03 superPerfect 阅读(348) 评论(0) 推荐(0) 编辑
摘要: .tar解包:tar xvf FileName.tar打包:tar cvf FileName.tar DirName(注:tar是打包,不是压缩!)———————————————.gz解压1:gunzip FileName.gz解压2:gzip -d FileName.gz压缩:gzip FileName.tar.gz解压:tar zxvf FileName.tar.gz压缩:tar zcvf FileName.tar.gz DirName———————————————.bz2解压1:bzip2 -d FileName.bz2解压2:bunzip2 FileName.bz2压缩: bzip2 阅读全文
posted @ 2014-03-16 15:57 superPerfect 阅读(317) 评论(0) 推荐(0) 编辑
摘要: //read操作加上超时时间。 1 int read_timeout(int fd, void *buf, uint32_t count, int time) 2 { 3 if(time > 0) { 4 fd_set rSet; 5 FD_ZERO(&rSet); 6 FD_SET(fd, &rSet); 7 8 struct timeval timeout; 9 memset(&timeout, 0, sizeof(timeout));10 timeout.tv_sec = time;... 阅读全文
posted @ 2014-03-16 15:52 superPerfect 阅读(2098) 评论(0) 推荐(0) 编辑