def __init__(self, response_handler, socket_file): """Initiate a connect attempt""" self.logger = logging.getLogger() Sender.register_response_handler(response_handler) client = ClientCreator(reactor, Sender) d = client.connectUNIX(socket_file) d.addCallback(self._got_protocol) d.addErrback(self._eb_got_protocol)
def getCtrl(self, service, protocol=None): """ Return an amp.AMP instance that """ if protocol is None: protocol = control.ControlClientProtocol basepath = FilePath(os.path.expanduser('~/.distfs')) cc = ClientCreator(reactor, protocol) return cc.connectUNIX(basepath.child('%s.ctrl' % service).path)