It very common to handle every incoming connection to the server, not in the parent process, but with child processes using
That way when the client is done with the server, the child process ends and, furthermore, the client is able to handle more than one connections simultaneously.
If you're programming under windows though, I don't know if you have a POSIX-like environment that supports these system calls...