Package muduo.rpc

Examples of muduo.rpc.RpcClient.blockingConnect()


public class Client {

    private static void blockingConnect(InetSocketAddress addr) throws Exception {
        RpcClient client = new RpcClient();
        RpcChannel channel = client.blockingConnect(addr);
        //sendRequest(channel, client);
        BlockingInterface remoteService = Sudoku.SudokuService.newBlockingStub(channel);
        SudokuRequest request = SudokuRequest.newBuilder().setCheckerboard("001010").build();
        SudokuResponse response = remoteService.solve(null, request);
        System.out.println(response);
View Full Code Here


        @Override
        public void run() {
            System.out.println(Thread.currentThread());
            RpcClient client = new RpcClient(channelFactory);
            RpcChannel channel = client.blockingConnect(serverAddr);
            BlockingInterface remoteService = EchoService.newBlockingStub(channel);
            String payload = new String(new byte[100]);
            payload = "Hello";
            EchoRequest request = EchoRequest.newBuilder().setPayload(payload).build();
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.