'Send the quit message and close the socket'

def close(self):

    if self._closed:
        raise err.Error('Already    closed')
    self._closed = True
    if (self._sock is None):
        return
    send_data = struct.pack('<iB', 1, COMMAND.COM_QUIT)
    try:
        self._write_bytes(send_data)
    except Exception:
        pass
    finally:
        self._force_close()
