The %closesocket() function closes an existing socket.
See your host OS documentation for more information on this function.