Topic: closesocket vs shutdown
I try sockets under Windows in a local network (SOCK_STREAM, WSA_FLAG_OVERLAPPED).
The client does 1000 connections to the server. Then closes 1000 connections on button click.
Sending of the data is not produced, but on each socket c asynchronous WSARecv.
And so. If I on the client cause simply closesocket (s) for each of 1000 sockets on the server all is caught rarely 1000 , but in the core on the average 50 - 400 connections it is necessary to hang (WSARecv the byte) does not signal about a zero amount. And it is not pleasant to me.
If I on the client do shutdown (s, SD_SEND), and then closesocket (s) for each of 1000 sockets on the client the first 600-800 sockets receive at once, remained are closed slowly in flow of 5-15 seconds.
This normal behavior of sockets at closing?:confused: