示例#1
0
 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
示例#2
0
文件: oscar.py 项目: samis/blockBox
    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)
示例#3
0
文件: socks.py 项目: samis/blockBox
 def connectClass(self, host, port, klass, *args):
     return protocol.ClientCreator(reactor, klass,
                                   *args).connectTCP(host, port)
示例#4
0
文件: oscar.py 项目: samis/blockBox
 def connectToBOS(self, server, port):
     c = protocol.ClientCreator(reactor, self.BOSClass, self.username,
                                self.cookie)
     return c.connectTCP(server, int(port))