i have been fidgeting with winsock tcp ( i created simple client and server applications with only a main function )
(i know this isn't the code but i'm trying to get the idea across i can post code if necessary)
server
Code:
accept
recv ( 17 bytes )
shutdown // listning and connected socket
closesocket // listning and connected socket
exit application
client
Code:
connect
send ( 17 bytes )
Sleep( 5000 )
send ( 17 bytes )
shutdown
closesocket
exit application
i started the server and then started the client. ( i'm using blocking sockets )
so basicly what i tried to do was:
- make the server wait for a connection
- recieve the 17 bytes sent by the client
- and exit the server application ( closing the sockets properly )
- see the error on the client side on the second attempt to send 17 bytes
i was suprised to see that the second attemp to send returned 17 bytes ( expected a SOCKET_ERROR ) eventhough the server application was no longer running. of course i'm a bit disturbed. can someone explain what's happening?