[CentOS] A question about why the function "recv" return 0

yf chu
Mon, 17 Dec 2018 05:30:14 -0000

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