I searched all over the Chinese and English websites, searched every corner I could find, and found the cause and principle of the malfunction, as well as how to deal with it. I recorded it here. I hope it can help friends in need and avoid detours. Above Let’s sort out the content:
connection reset by peer problem summary and solution
1. The number of concurrent connections of the server exceeds its capacity, and the server will close some of the connections
If you know the number of concurrent clients actually connected to the server, there is no If the load capacity of the server is exceeded, there may be a virus or Trojan horse, causing abnormal network traffic.
Solution: You can use the netstat -an command to check the network connection status.
2. The client closed the browser, but the server is still sending data to the client
3. The browser pressed Stop
These two situations generally will not affect the server, but if there is no special handling of the abnormal information , it is possible that this exception appears repeatedly in the server's log file, causing the server log file to be too large and affecting the operation of the server.
Solution: You can use try...catch to capture the exception that caused the exception, and then do not output or only output a prompt message to avoid outputting all exception information.
4. Firewall problem
If the network connection passes through the firewall, and the firewall generally has a timeout mechanism, when the network connection does not transmit data for a long time, the TCP session will be closed. After closing, reading and writing will cause abnormal.
Solution: If turning off the firewall solves the problem, you need to reconfigure the firewall or write your own program to implement long TCP connections.
To implement a long TCP connection, you need to define the heartbeat protocol yourself. Every once in a while, a heartbeat protocol is sent and the two parties maintain the connection.
5. JSP buffer problem
The default cache of JSP pages is 8K. When the JSP page data is relatively large, it is possible that the JSP is not completely transmitted to the browser.
Solution: You can adjust the buffer size appropriately.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

Dreamweaver CS6
Visual web development tools

Dreamweaver Mac version
Visual web development tools

Notepad++7.3.1
Easy-to-use and free code editor

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.