I am an open source project developer, and I had problems with the server, which decided that it completely answered the socket (this means that it either sent a response or closed it in response to a failure), and the client got stuck in the survey ( ) After some research, I found that close () does not always generate a POLLHUP event, but shutdown (sock, 2).
In light of this, I am considering adding shutdown (sock, 2) in the case of error handling (in addition to calling close ()). Does anyone know of some of the reasons that can cause problems? Am I barking the wrong tree? I think that if the server believes that the socket is closed, the client should definitely do nothing with this socket, and I cannot think of reasons not to add this, but I have not worked with tcp for this for a long time and would like to get some advice .
dbeer source
share