def _startLogOn(self, chatui): logonDeferred = defer.Deferred() cc = protocol.ClientCreator(reactor, IRCProto, self, chatui, logonDeferred) d = cc.connectTCP(self.host, self.port) d.addErrback(logonDeferred.errback) return logonDeferred
def oscar_01_05(self, snac, d=None): """ data for a new service connection d might be a deferred to be called back when the service is ready """ tlvs = readTLVs(snac[3][2:]) service = struct.unpack('!H', tlvs[0x0d])[0] ip = tlvs[5] cookie = tlvs[6] #c = serviceClasses[service](self, cookie, d) c = protocol.ClientCreator(reactor, serviceClasses[service], self, cookie, d) def addService(x): self.services[service] = x c.connectTCP(ip, 5190).addCallback(addService)
def connectClass(self, host, port, klass, *args): return protocol.ClientCreator(reactor, klass, *args).connectTCP(host, port)
def connectToBOS(self, server, port): c = protocol.ClientCreator(reactor, self.BOSClass, self.username, self.cookie) return c.connectTCP(server, int(port))