Reputation: 121
Windows socket close(closesocket) function generates RST.
On linux when I call close function to close a tcp socket it goes through fin/ack from both client server and the socket gets closed.
But on windows winsock, whenever i call closesocket it always generates RST message.
I tried using shutdown call. It is generating FIN. But finally I have to call closesocket and it sends RST.
Is there a way to call closesocket to release socket resources without sending RST message.
Upvotes: 4
Views: 1856
Reputation: 19
If there are no more data to send and/or receive, you can use 'shutdown()'.
Ex: shutdown(clisocket, SD_BOTH);
Upvotes: 1
Reputation: 310860
There are several things that can cause closesocket()
to send an RST instead of a FIN:
Upvotes: 2