07 2018 档案
CentOS 5 常见的configure error的解决方法
摘要:仅限于CentOS 5 configure: error: No curses/termcap library found 网上有的说法是: --with-named-curses-libs=/usr/lib/libncursesw.so.5 其实是不对的,虽然能解决configure的错误,但是m 阅读全文
posted @ 2018-07-26 11:04 IT8343 阅读(1755) 评论(0) 推荐(0)
网络编程——I/O复用
摘要:int select( int nfds, fd_set FAR* readfds, fd_set * writefds, fd_set * exceptfds, const struct timeval * timeout); nfds:是一个整数值,是指集合中所有文件描述符的范围,即所有文件描述 阅读全文
posted @ 2018-07-08 17:23 IT8343 阅读(252) 评论(0) 推荐(0)
网络编程——UDP编程
摘要:一个简单的聊天代码:运行结果: 在这个程序之中,由于recvfrom函数拥塞函数,没有数据时会一直阻塞,所以客户端和服务器端只能通过一回一答的方式进行信息传递。严格的讲UDP没有明确的客户端和服务端,谁先进行数据传输,谁就是客户端,客户端也有可能是服务器端。 代码1: 代码2: 阅读全文
posted @ 2018-07-07 20:28 IT8343 阅读(275) 评论(0) 推荐(0)
I\O复用
摘要:客户端的代码和前面的一样,所以这里只给出服务器端的代码,根据代码进行理解: 阅读全文
posted @ 2018-07-06 23:58 IT8343 阅读(458) 评论(0) 推荐(0)
文件锁
摘要:运行结果: 阅读全文
posted @ 2018-07-04 21:42 IT8343 阅读(285) 评论(0) 推荐(0)
常用的头文件—— common.h
摘要:#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #includ... 阅读全文
posted @ 2018-07-04 19:17 IT8343 阅读(3635) 评论(0) 推荐(0)
网络编程2.0——多线程
摘要:代码1:服务器端: 代码2:客户端(主要是创建连接、发送数据) 阅读全文
posted @ 2018-07-04 19:14 IT8343 阅读(176) 评论(0) 推荐(0)
网络编程1.0
摘要:socket: 函数原型: int socket(int domain, int type, int protocol); 网络上的两个程序通过一个双向的通信连接实现数据的交换,这个连接的一端称为一个socket。 建立网络通信连接至少要一对端口号(socket)。socket本质是编程接口(API 阅读全文
posted @ 2018-07-03 23:35 IT8343 阅读(155) 评论(0) 推荐(0)
管道/FIFO
摘要:管道: 运行结果: FIFO(有名管道): 代码1:写文件程序 代码2:读文件程序: 运行结果:右边输入,左边输出 另一种FIFO(边读边写) 代码1: 代码2: 输出结果: 阅读全文
posted @ 2018-07-02 21:44 IT8343 阅读(252) 评论(0) 推荐(0)