Server.java 563 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
package bidirectional;

import io.grpc.ServerBuilder;
import java.io.IOException;

public class Server {
    public static void main( String[] args ) {
        try {
            io.grpc.Server server = ServerBuilder.forPort(8888).addService(new BidirectionalServiceImpl()).build();
            server.start();
            System.out.println("Server started!\n");
            server.awaitTermination();
        } catch (IOException e) {
            e.printStackTrace();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}