def connect(self):
        self.socket = socket.socket(self.address_family,
                                    self.socket_type)
	while not self.isclosed:
	    try:
		# print 'connecting'
		self.socket.connect(self.server_address)
	    except SystemExit:
		raise
	    except socket.error:
		if self.isclosed:
		    raise
		time.sleep(2)
	    else:
                break
        else:
            return

        #print 'CONNECTED'
        self.stdout = self.socket.makefile('w', bufsize=0)
        self.stdin = NotiInput(self.socket.makefile('r'), self.stdout)
        self.stderr = sys.stderr

        if sys.version_info < (2, 4):
            self.interruptible = 0
	else:
            self.start_ki_thread()
            self.interruptible = 1

        cmd.Cmd.__init__(self, stdin=self.stdin, stdout=self.stdout)
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/guppy-0.1.10/guppy/heapy/Remote.py/Annex.connect/original