The short answer:
Stop pressing CTRL-C
, kidding.
The long answer:
There are a couple of things you could do:
1) You could change the reconnection options on the client, perhaps set reconnection
to false. But maybe this is not desirable for the real world, so instead you could do:
2) Disconnect the client socket from the server right before the server exits. The exit strategy for this will depend on what server you use.
3) If options one and two are not viable, then there isn't much you could do since you are shutting down the server and leaving your client hanging — stuck in time thinking that the server will someday return. Not that it cares, though. You're console is the one with the big mouth...
I hope that helps!