Originally posted by JoshT When Winsock closes, it stops listening (actually, probably when it accepts the connection). You have to tell it to start listening again.
You are correct. When the server uses only one socket, it has to go from listening to connected. Then when it sees the close from the client, it has to go back to the listening state.
I am attaching a small client/server demo that I put together to help with a number of issues like this and passing UDTs. Both the client and server are small, but are heavily commented. As I get the time, I will add more error checking, but I feel that it is a better example than the one found on this site which has the socket being closed immediately after the send. That code has caused a lot of forum members a lot of grief.