On Thu, 16 May 2002, Jeremy Howard wrote: > I *strongly* recommend also including shutdown.diff. This is important > in Linux to avoid sockets handing around in CLOSE_WAIT state. Remove the
I had a talk with some kernel people, and they confirmed that. shutdown(socket, SHUT_RD) should _always_ be done under linux if you really don't need to read from the socket anymore. For AF_INET* sockets, anyway. shutdown(socket, SHUT_RDWR) will reduce the CLOSE_WAIT state even more, however it effectively trashes the connection; I don't like this idea very much. It is far more amiable to the client if you let it read the last stuff you sent it (such as error messages!) at its own leisure. I am, thus, somewhat wary of adding SHUT_RDWR inconditionally. Maybe we could add a runtime-option that very busy sites can set if they need even faster socket recycling? -- "One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie." -- The Silicon Valley Tarot Henrique Holschuh