I am writing an IRC client in C ++, and currently I have a problem when after exiting I do:
Send ("QUIT: Quit \ r \ n"); // just an inline, variadic send () wrapper
shutdown (m_hSocket, SD_BOTH);
closesocket (m_hSocket);
WSAShutdown ();
However, the problem is that the QUIT message is not sent. I sniffed the packets coming from the client and reminded that this message is never sent. I believe this is a problem with the socket not being reset, but I have no idea how to do this, and Google suggested disabling the Nagle algorithm, but I doubt it is good practice.
Thanks in advance.
source share