Skip to content

Instantly share code, notes, and snippets.

@KKcorps
Created September 10, 2019 04:32
Show Gist options
  • Save KKcorps/d772f3723da823d751b668938dd9c6de to your computer and use it in GitHub Desktop.
Save KKcorps/d772f3723da823d751b668938dd9c6de to your computer and use it in GitHub Desktop.
server.java
public GreeterServer(int port) throws IOException {
this(ServerBuilder.forPort(port), port);
}
public GreeterServer(ServerBuilder<?> serverBuilder, int port) {
this.port = port;
server = serverBuilder.addService(new GreeterImpl()).build();
}
public void start() throws IOException {
server.start();
logger.info("Server started, listening on " + port);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment