Package muduo.rpc.proto.RpcProto

Examples of muduo.rpc.proto.RpcProto.RpcMessage


                SudokuService.newReflectiveService(mockImpl));
        RpcChannel channel = new RpcChannel(mockChannel);
        channel.setServiceMap(services);

        SudokuRequest sudokuRequest = SudokuRequest.newBuilder().setCheckerboard("001010").build();
        RpcMessage request = RpcMessage.newBuilder()
                .setType(MessageType.REQUEST)
                .setId(2)
                .setService(SudokuService.getDescriptor().getFullName())
                .setMethod("Solve")
                .setRequest(sudokuRequest.toByteString())
                .build();

        channel.messageReceived(null, new UpstreamMessageEvent(mockChannel, request, null));
        assertEquals(sudokuRequest, gotRequest);

        RpcMessage response = RpcMessage.newBuilder()
                .setType(MessageType.RESPONSE)
                .setId(2)
                .setResponse(sudokuResponse.toByteString())
                .build();
        assertEquals(response, mockChannel.message);
View Full Code Here


                    buffer.markReaderIndex();
                    buffer.readerIndex(buffer.writerIndex() - 4);
                    int checksum = buffer.readInt();
                    if (checksum == (int)adler32.getValue()) {
                        buffer.resetReaderIndex();
                        RpcMessage message = RpcMessage.newBuilder().mergeFrom(
                                buffer.array(),
                                buffer.arrayOffset() + buffer.readerIndex() + 4,
                                buffer.readableBytes() - 8).build();
                        return message;
                    }
View Full Code Here

TOP

Related Classes of muduo.rpc.proto.RpcProto.RpcMessage

Copyright © 2018 www.massapicom. 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.