ChinaUnix.net
相关文章推荐:

epoll example

Linux 2.6内核中提高网络I/O性能的新方法epoll 正如我昨天在“Linux下各类TCP网络服务器的实现源代码”( http://zhoulifa.bokee.com/5345930.html )一文中提到的那样,I/O多路复用技术在比较多的TCP网络服务器中有使用,即比较多的用到select函数。 感谢chinaunix.net上朋友safedead( http://bbs.chinaunix.net/viewpro.php?uid=407631 )提醒,我今天仔细研究了一下,证实了在2.6内核中的新的I/O技术epoll。 1、为什么select是...

by jiablog - 网络技术文档中心 - 2009-01-11 00:59:06 阅读(1946) 回复(0)

相关讨论

#include sys/types.h> #include netinet/in.h> #include sys/event.h> #include sys/time.h> #include sys/socket.h> #include sys/types.h> #include arpa/inet.h> #include unistd.h> #include stdlib.h> #include string.h> #include stdio.h> #define err(msg) perror(msg) #define SA struct sockaddr struct event { int fd; void (*handle)(struct event *); }; static int tcp_listen(void) { ...

by @sky - BSD文档中心 - 2009-08-28 14:04:03 阅读(2212) 回复(0)

发现epoll 有个问题, 连接上后,客户端连续发送两个请求,epoll 只检测到一个可读事件! 郁闷, 如果客户端是多线程,有可能同时向同一个socket发送消息,这样服务端这边的epoll就只检测到一个可读事件, 有啥办法没。 对于服务端创建的那个监听socket 可以用 while(1) { accept(); ...

by 齐得龙强更强 - C/C++ - 2009-08-24 22:30:17 阅读(7521) 回复(13)

epoll_wait函数的返回值 是不是就是poll函数中的参数 nfds?

by debuger - C/C++ - 2008-10-28 16:49:20 阅读(1366) 回复(2)

server端: ev.data.fd=connfd; ev.events=epollIN|epollOUT|epollET; epoll_ctl(epfd,epoll_CTL_ADD,connfd,&ev); while(1) { nfds=epoll_wait(epfd,events,20,500); for(i=0;i<=nfds;i++) { if(events.events&epollIN) { recv(events.data.fd,line,5,0); ......... } else if(events.events&epollOUT) { do_process(); } ...

by chenzhanyiczy - C/C++ - 2009-02-04 11:11:37 阅读(3006) 回复(18)

http://www.lightbird.net/py-by-example/ Python自带的Tutorial看了没什么收获,还是没上手。可以看看这个,我觉得不错。

by diker007 - Python - 2009-05-28 13:53:19 阅读(1787) 回复(3)

Browsing other peoples’ code is a great way to learn new things about a language or framework. I never made it to the Django docs about Contexts, but the Pinax developers apparently did and I got a chance to learn this from them. This is a few sections of their code and how they use RequestContext in their apps. If you are looking at the source of some of their views you might see how they are...

by cobrawgl - Python文档中心 - 2009-04-05 19:59:56 阅读(1893) 回复(0)

:shock: :shock: [ 本帖最后由 饭盒 于 2008-12-2 11:07 编辑 ]

by 饭盒 - Oracle - 2008-11-29 15:16:06 阅读(1465) 回复(0)

[color="#000066"]Hibernate应用开发完全手册 [color="#0000ff"]Hibernate应用开发完全手册 [color="#0000ff"]2.8 在Eclipse上创建Hibernate实例[color="#0000ff"] [color="#0000ff"]http://book.csdn.net/ 2007-9-12 16:33:00 图书导读 当前章节: [color="red"]2.8 在Eclipse上创建Hibernate实例 · [color="#0000ff"]2.5 创建持久化类及映射文件 · [color="#0000ff"]2.6 构建SessionFactory · [color="#0000ff"]2....

by cspyb - Java文档中心 - 2008-01-15 02:55:12 阅读(1105) 回复(0)

An example of FreeBSD KLD programming. It outlines how to create/use the dependences between modules. To test it. [root@~]# make install [root@~]# kldload dephello [root@~]# kldunload dephello 文件:hello.tar.gz 大小:1KB 下载: 下载 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/10543/showart_280976.html

by mingyanguo - BSD文档中心 - 2007-04-18 21:13:27 阅读(1285) 回复(0)