Comments (6)
有具体的代码出处吗?
from nginx-book.
对于监听的socket,其注册的时候:
epoll_ctl(3, EPOLL_CTL_ADD, 6, {EPOLLIN, {u32=3033583632, u64=47578386321424}}) = 0
并没有设置EPOLLET,而epoll默认是水平触发(The default behaviour for epoll is Level Triggered)
from nginx-book.
listen的句柄都是水平触发的。
from nginx-book.
监听的是LT,accept的新连接(epoll的时候)是ET。
from nginx-book.
epoll_ctl(3, EPOLL_CTL_ADD, 6, {EPOLLIN, {u32=529362960, u64=47575882100752}}) = 0
gettimeofday({1361245029, 209264}, NULL) = 0
epoll_wait(3, {{EPOLLIN, {u32=529362960, u64=47575882100752}}}, 8192, 4294967295) = 1 //新的连接到来事件
gettimeofday({1361245031, 839885}, NULL) = 0
accept(6, {sa_family=AF_INET, sin_port=htons(39729), sin_addr=inet_addr("xxx.xxx.xxx.161")}, [16]) = 7 //accept
ioctl(7, FIONBIO, [1]) = 0
epoll_ctl(3, EPOLL_CTL_ADD, 7, {EPOLLIN|EPOLLET, {u32=529363144, u64=47575882100936}}) = 0 //对这个新的tcp连接的后续过程设置EPOLLET
epoll_wait(3, {{EPOLLIN, {u32=529363144, u64=47575882100936}}}, 8192, 8000) = 1
gettimeofday({1361245031, 840149}, NULL) = 0
recvfrom(7, "GET /index.html HTTP/1.1\r\nUser-A"..., 1024, 0, NULL, NULL) = 136
epoll_ctl(3, EPOLL_CTL_MOD, 7, {EPOLLIN|EPOLLOUT|EPOLLET, {u32=529363144, u64=47575882100936}}) = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 8
ioctl(8, FIONBIO, [1]) = 0
epoll_ctl(3, EPOLL_CTL_ADD, 8, {EPOLLIN|EPOLLOUT|EPOLLET, {u32=529363328, u64=47575882101120}}) = 0
connect(8, {sa_family=AF_INET, sin_port=htons(18080), sin_addr=inet_addr("xxx.xxx.xxx.161")}, 16) = -1 EINPROGRESS (Operation now in progress)
epoll_wait(3, {{EPOLLIN|EPOLLERR|EPOLLHUP, {u32=529363328, u64=47575882101120}}, {EPOLLOUT, {u32=529363144, u64=47575882100936}}}, 8192, 60000) = 2
gettimeofday({1361245031, 840608}, NULL) = 0
getsockopt(8, SOL_SOCKET, SO_ERROR, [-7710985409072725905], [4]) = 0
write(4, "2013/02/19 11:37:11 [error] 2193"..., 274) = 274
close(8) = 0
getsockname(7, {sa_family=AF_INET, sin_port=htons(28080), sin_addr=inet_addr("xxx.xxx.xxx.161")}, [16]) = 0
writev(7, [{"HTTP/1.1 502 Bad Gateway\r\nServer"..., 152}, {"\r\n<title>502 Bad Gat"..., 176}, {" Sorry for the inconvenience.<br"..., 347}, {"
Powered by Tengine\r\n"..., 43}], 5) = 770
write(5, "xxx.xxx.xxx.161 - - [19/Feb/2013:"..., 147) = 147
setsockopt(7, SOL_TCP, TCP_NODELAY, [1], 4) = 0
recvfrom(7, "", 1024, 0, NULL, NULL) = 0
close(7) = 0
epoll_wait(3,
from nginx-book.
谢谢,我已经修正了这个错误描述。
from nginx-book.
Related Issues (20)
- 背景介绍¶
- 使用lua模块
- nginx平台初探(30%)¶ nginx的配置系统¶
- nginx平台初探(100%)¶ ngx_strcmp(s1, s2)
- 高性能服务器设计¶ 高性能服务器编写的关键原则¶
- Nginx开发从入门到精通¶ 目录¶
- 背景介绍¶ 使用简介¶
- upstream模块¶ r->main->count++;ngx_http_upstream_init(r);return NGX_DONE;
- 背景介绍¶ nginx特点介绍¶
- 背景介绍¶ nginx特点介绍¶
- nginx架构详解(50%)¶ 定时器实现¶
- nginx平台初探(100%)¶ 初探nginx架构(100%)¶
- 背景介绍¶ 背景介绍¶ HOT 2
- 背景介绍 HOT 1
- nginx架构详解(50%)¶ nginx的事件机制¶ HOT 2
- nginx架构详解(50%)¶ nginx的事件机制¶ HOT 2
- 背景介绍¶ nginx特点介绍¶ HOT 1
- 背景介绍¶ nginx历史¶ HOT 1
- 模块开发高级篇(30%)¶ upstream¶ HOT 2
- 附录B 常用API¶ B.2 读取请求体¶ HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nginx-book.