Exemplo n.º 1
0
    def _create_connection(self, type):
        transport = TTornadoStreamTransport(self.__host, self.__port)
        pfactory = TBinaryProtocolFactory()
        connection = self.__client_cls(transport, pfactory)
        rpc_connection = RPCConnection(self.__host + ':' + str(self.__port) + ':' + str(self.__weight), type, connection)

        try:
            transport.open()
        except Exception,e:
            pass