close the open socket