Package com.chenshuo.muduo.protorpc.echo.EchoProto

Examples of com.chenshuo.muduo.protorpc.echo.EchoProto.EchoRequest.toByteString()


        RpcEncoder encoder = new RpcEncoder();
        EchoRequest request = EchoRequest.newBuilder().setPayload("Hello").build();
        RpcMessage message = RpcMessage.newBuilder().setType(MessageType.REQUEST).setId(1)
                .setService(EchoService.getDescriptor().getName())
                .setMethod(EchoService.getDescriptor().getMethods().get(0).getName())
                .setRequest(request.toByteString()).build();
        encoder.encode(null, null, message);
    }

    @Test
    public void testDecoder() throws Exception {
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.