A Question About Why The Function “recv” Return 0

Home » CentOS » A Question About Why The Function “recv” Return 0
CentOS 3 Comments

I am a website developer. We deploy a Nginx server on CentOS to provide HTTP services. Recently, some customers of our website were complaining about that occasionally they could not open the webpage, the web browser show that the tcp connection was reset. I checked the Nginx logs and source code and found that the function “recv” return 0 when some customers made HTTP requests. Our customers have confirmed that their network was ok at that time. Now, I could not find any clue about this issue. Is there any solution to find the reason? Does it have something to do with firewall, or ISP? Can we find something from the system log?

3 thoughts on - A Question About Why The Function “recv” Return 0

  • All my references say that recv() returns zero when the link has been shut down cleanly by the other end.

    You say that the other end hasn’t done so, but possibly there are one or more proxies in the middle,… maybe one of them has dropped the link for some reason.

  • I have used tcpdump to capture the data packets and found that after the ssl handshake, the client side reset the tcp connection. Is there any method to pinpoint the culprit who drops the tcp connection?

    At 2018-12-18 01:58:36, “Fred Smith” wrote: