郑州网站推广地址,wordpress 模板 含数据,网站建设维护的方案,wordpress如何配置伪静态161310 cient端收到synack后#xff0c;根据ack值#xff0c;使用SACK算法#xff0c;只重传最后一个ack内容。Server端收到数据包#xff0c;由于accept队列仍然是满的#xff0c;所以server端处理也只是标记acked#xff0c;然后返回。162884 client端等待几秒后#…161310 cient端收到synack后根据ack值使用SACK算法只重传最后一个ack内容。Server端收到数据包由于accept队列仍然是满的所以server端处理也只是标记acked然后返回。162884 client端等待几秒后没有收到对应的ack认为之前的数据包也丢失所以重传之前的内容数据包。Server端收到数据包由于accept队列仍然是满的所以server端处理也只是标记acked然后返回。164828 client端等待一段时间后认为连接不可用于是发送FIN、ACK给server端。Client端的状态变为FIN_WAIT1等待一段时间后client端将看不到该链接。164829 server端收到ACK后此时cgi程序处理完一个请求从accept队列中取走一个连接此时accept队列中有了空闲server端将请求的连接放到accept队列中。这样cgi所在的服务器上显示该链接是established的但是nginx(client端)所在的服务器上已经没有该链接了。之后当cgi程序从accept队列中取到该连接后调用read去读取sock中的内容但是由于client端早就退出了所以read就会block那里了。问题解决或许你会认为在164829中server端不应该建立连接这是内核的bug。但是内核是按照RFC来实现的在3次握手的过程中是不会判断FIN标志位的只会处理SYN、ACK、RST这三种标志位。从应用层的角度来考虑解决问题的方法那就是使用非阻塞的方式read或者使用select超时方式read;亦或者nginx中关闭连接的时候使用RST方式而不是FIN方式。附录1when I use linux TCP socket, and find there is a bug in function sk_acceptq_is_full()When a new SYN comes, TCP module first checks its validation. If valid,send SYN,ACK to the client and add the sockto the syn hash table.Next time if received the valid ACK for SYN,ACK from the client. server will accept this connection and increase thesk-sk_ack_backlog -- which is done in function tcp_check_req().We check wether acceptq is full in function tcp_v4_syn_recv_sock().Consider an example:After listen(sockfd, 1) system call, sk-sk_max_ack_backlog is set toAs we know, sk-sk_ack_backlog is initialized to 0. Assuming accept() system call is not invoked now1. 1st connection comes. invoke sk_acceptq_is_full(). sk-sk_ack_backlog0 sk-sk_max_ack_backlog1, function return 0 accept this connection. Increase the sk-sk_ack_backlog2. 2nd connection comes. invoke sk_acceptq_is_full(). sk-sk_ack_backlog1 sk-sk_max_ack_backlog1, function return 0 accept this connection. Increase the sk-sk_ack_backlog3. 3rd connection comes. invoke sk_acceptq_is_full(). sk-sk_ack_backlog2 sk-sk_max_ack_backlog1, function return 1. Refuse this connection.I think it has bugs. after listen system call. sk-sk_max_ack_backlog1but now it can accept 2 connections.