Package muduo.rpc

Examples of muduo.rpc.RpcServer


import muduo.rpc.RpcServer;

public class Server {

    public static void main(String[] args) {
        RpcServer server = new RpcServer();
        server.registerService(Sudoku.SudokuService.newReflectiveService(new SudokuImpl()));
        server.setNewChannelCallback(new NewChannelCallback() {

            @Override
            public void run(RpcChannel channel) {
                // TODO call client

            }
        });
        server.start(9981);
    }
View Full Code Here


import muduo.rpc.RpcServer;

public class EchoServer {

    public static void main(String[] args) {
        RpcServer server = new RpcServer();
        server.registerService(EchoProto.EchoService.newReflectiveService(new Interface() {
            @Override
            public void echo(RpcController controller, EchoRequest request, RpcCallback<EchoResponse> done) {
                done.run(EchoResponse.newBuilder().setPayload(request.getPayload()).build());
            }
        }));
        server.start(8888);
    }
View Full Code Here

TOP

Related Classes of muduo.rpc.RpcServer

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.