close socket on successful usage