I haven't noticed any issues with closing a socket when an error
is found, though I always like to use winsock.shutdown() and
CloseSocket(Socket) as well.
Make sure you use Try...except blocks around any questionable
method calls, and always, without a doubt use a memory leak
checker like memproof.