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
在前文Android——4.2 - 3G移植之路之 reference-ril .pppd 拨号上网 (三) 中分析了3G连接网络的流程,其中有说道通过AT指令建立连接,
在这里记录一下3G中的AT通信....
分类:
移动开发 时间:
2014-11-17 17:46:22
阅读次数:
353
原文地址:http://zhidao.baidu.com/question/82001542.html?qbl=relate_question_3&word=MVC%20%CA%FD%BE%DD%B7%C3%CE%CA%B2%E3%BF%C9%D2%D4%CA%A1%C2%D4%C2%F0MVC和三...
分类:
Web程序 时间:
2014-11-17 13:45:51
阅读次数:
161
创建一个空洞文件#include #include #include int main(){ int fd=open("hole",O_WRONLY | O_CREAT,0666); write(fd,"1G hole are coming",strlen("1G hole are co...
分类:
其他好文 时间:
2014-11-14 17:28:11
阅读次数:
105
获取文件属性(struct stat):int stat(const char* restrict pathname,struct stat* restrict buf);int fstat(int fd,struct stat* restrict buf);int lstat(const char...
分类:
其他好文 时间:
2014-11-14 17:15:34
阅读次数:
252
client_thread.c#include #include #include #include #include #include int main(int argc,char *argv[]){ int connect_fd; int ret; char snd_buf[1...
分类:
其他好文 时间:
2014-11-12 07:04:46
阅读次数:
250
Linux文件系统结构/bin 二进制的缩写,用来放置可执行的二进制程序,基本命令/boot 用来存放启动文件,kernel 和boot配置文件/dev 用来放置设备文件 /dev/console 默认的系统控制台,包括显示器与键盘 /dev/fd 软盘驱动器 /dev/hd IDE硬盘设备 ...
分类:
系统相关 时间:
2014-11-11 10:43:06
阅读次数:
150
文件操作篇closecreatdupdup2fcntlflockfsynclseekmkstempopenreadsyncwriteclose(关闭文件)相关函数open,fcntl,shutdown,unlink,fclose表头文件#include定义函数int close(int fd);函数...
分类:
其他好文 时间:
2014-11-10 01:01:48
阅读次数:
230
上一节简单的介绍了服务器消息处理的流程,想必大家对这方面有了初步的认识,接下来我们需要知道和掌握的便是其中一些重要的方法,进一步深入熟悉整个构架。 1、FD_*系列宏函数 FD_ZERO(fd_set *fdset) 将指定的文件描述符集清空,在对文件描述符集合进行设置前,必须对其进行初始化,如.....
分类:
Web程序 时间:
2014-11-09 11:12:36
阅读次数:
327
练习:文件传输的功能
首先教大家一个函数
int ftruncate(int fd,off_t length)
功能:将fd指定的文件大小改为参数length指定大小
注:fd必须是以写入的模式打开。
参数:fd 为已经打开文件的文件描述符
length 为文件指定大小
返回值:成功返回0,失败返回-1.
client 传文件给 s...
分类:
其他好文 时间:
2014-11-08 16:49:47
阅读次数:
155