Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package server;
- import java.io.IOException;
- import io.grpc.Server;
- import io.grpc.ServerBuilder;
- public class UserServer {
- public static void main(String[] args) throws IOException, InterruptedException {
- System.out.println("Server start");
- Server server = ServerBuilder.forPort(50051).addService(new Service()).build();
- server.start();
- Runtime.getRuntime().addShutdownHook(new Thread(() -> {
- server.shutdown();
- }));
- server.awaitTermination();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement