Search the English and Chinese websites, rummaged around the corner, found the cause and principle of failure, and how to deal with, here, record, hope to help the need for small partners, less take a detour, the above on the finishing content:
Summary and solution of connection reset by peer problem
1. The number of concurrent connections to the server exceeds its load, and the server closes some of the connections
If you know the actual number of concurrent clients connected to the server does not exceed the server load, it is possible to be a virus or trojan, causing network traffic anomalies.
workaround : You can use the Netstat-an command to view network connectivity.
2. The client has turned off the browser and the server is sending data to the client
3. The browser presses the stop
These two situations generally do not affect the server, but if the exception information is not specifically handled, it is possible in the server's log file, repeated the exception, causing the server log file too large, affecting the server's operation.
workaround : You can catch an exception by using Try...catch on the part that causes the exception, and then do not output or output only one message to avoid outputting all the exception information.
4. Problems with Firewalls
If the network connection through the firewall, and the firewall will generally have a time-out mechanism, when the network connection for a long time does not transfer data, will shut down the TCP session, and then read and write after shutdown, will cause an exception.
Workaround: If you turn off the firewall, fix the problem, reconfigure the firewall, or write your own program to implement TCP's long connection.
To implement a long connection to TCP, you need to define your own heartbeat protocol, which sends a heartbeat protocol at a time, and the two sides maintain the connection.
5.JSP buffer problem
JSP page Default cache 8K, when the JSP page data is larger, it is possible that the JSP is not fully passed to the browser.
Solution : The size of the buffer can be adjusted appropriately.
<%@ page buffer= "100k"%>
Thank you for reading, I hope to help you, thank you for your support for this site!