Examples of readMessageBegin()


Examples of com.facebook.thrift.protocol.TProtocol.readMessageBegin()

      TMessage output = null;

      proto.writeMessageBegin(msg);
      proto.writeMessageEnd();

      output = proto.readMessageBegin();

      if (!msg.equals(output)) {
        throw new RuntimeException("Message was supposed to be " + msg + " but was " + output);
      }
    }
View Full Code Here

Examples of org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin()

        if ( bis.markSupported() ) {
            bis.reset();
            bis.skip( headerLength );
        }

        TMessage message = protocol.readMessageBegin();
        Assert.assertEquals( "echoString", message.name );
        Assert.assertEquals( TMessageType.REPLY, message.type );
        Assert.assertEquals( ThriftCodec.getSeqId(), message.seqid );
        Demo.echoString_result result = new Demo.echoString_result();
        result.read( protocol );
View Full Code Here

Examples of org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin()

        if ( bis.markSupported() ) {
            bis.reset();
            bis.skip( headerLength );
        }

        TMessage message = protocol.readMessageBegin();
        Assert.assertEquals( "echoString", message.name );
        Assert.assertEquals( TMessageType.EXCEPTION, message.type );
        Assert.assertEquals( ThriftCodec.getSeqId(), message.seqid );
        TApplicationException exception = TApplicationException.read( protocol );
        protocol.readMessageEnd();
View Full Code Here

Examples of org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin()

        if ( bis.markSupported() ) {
            bis.reset();
            bis.skip( headerLength );
        }

        TMessage message = protocol.readMessageBegin();

        Demo.echoString_args args = new Demo.echoString_args();

        args.read( protocol );
View Full Code Here

Examples of org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin()

        try
        {
            TTransport transport = new TChannelBufferInputTransport(buffer);
            TBinaryProtocol protocol = new TBinaryProtocol(transport);

            protocol.readMessageBegin();
            TProtocolUtil.skip(protocol, TType.STRUCT);
            protocol.readMessageEnd();

            messageBuffer = buffer.slice(messageBeginIndex, buffer.readerIndex());
        }
View Full Code Here

Examples of org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin()

            TNiftyTransport transport = new TNiftyTransport(channel,
                                                            buffer,
                                                            ThriftTransportType.UNFRAMED);
            TBinaryProtocol protocol = new TBinaryProtocol(transport);

            protocol.readMessageBegin();
            TProtocolUtil.skip(protocol, TType.STRUCT);
            protocol.readMessageEnd();

            messageBuffer = buffer.slice(messageBeginIndex, buffer.readerIndex());
        }
View Full Code Here

Examples of org.apache.thrift.protocol.TProtocol.readMessageBegin()

    {
        try {
            messageBuffer.markReaderIndex();
            TTransport inputTransport = new TChannelBufferInputTransport(messageBuffer);
            TProtocol inputProtocol = getProtocolFactory().getInputProtocolFactory().getProtocol(inputTransport);
            TMessage message = inputProtocol.readMessageBegin();
            messageBuffer.resetReaderIndex();
            return message.seqid;
        } catch (Throwable t) {
            throw new TTransportException("Could not find sequenceId in Thrift message");
        }
View Full Code Here

Examples of org.apache.thrift.protocol.TProtocol.readMessageBegin()

                    new TNiftyTransport(channel, buffer, ThriftTransportType.UNFRAMED);
            TProtocol inputProtocol =
                    this.inputProtocolFactory.getProtocol(decodeAttemptTransport);

            // Skip through the message
            inputProtocol.readMessageBegin();
            TProtocolUtil.skip(inputProtocol, TType.STRUCT);
            inputProtocol.readMessageEnd();

            messageLength = buffer.readerIndex() - messageStartReaderIndex;
        } catch (IndexOutOfBoundsException e) {
View Full Code Here

Examples of org.apache.thrift.protocol.TProtocol.readMessageBegin()

      TMessage output = null;
     
      proto.writeMessageBegin(msg);
      proto.writeMessageEnd();

      output = proto.readMessageBegin();

      if (!msg.equals(output)) {
        throw new RuntimeException("Message was supposed to be " + msg + " but was " + output);
      }
    }
View Full Code Here

Examples of org.apache.thrift.protocol.TProtocol.readMessageBegin()

    {
        try {
            messageBuffer.markReaderIndex();
            TTransport inputTransport = new TChannelBufferInputTransport(messageBuffer);
            TProtocol inputProtocol = getProtocolFactory().getInputProtocolFactory().getProtocol(inputTransport);
            TMessage message = inputProtocol.readMessageBegin();
            messageBuffer.resetReaderIndex();
            return message.seqid;
        } catch (Throwable t) {
            throw new TTransportException("Could not find sequenceId in Thrift message");
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.