change a close() call to closesocket() for win - submitted by Shane Caraveo