blob: 3390b47d09848ff32cc878364f029e582834f125 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
package moe.yuuta.dn42peering.agent.grpc;
import io.vertx.core.AbstractVerticle;
import io.vertx.core.Promise;
import io.vertx.grpc.VertxServer;
import io.vertx.grpc.VertxServerBuilder;
import moe.yuuta.dn42peering.RPC;
public class RPCVerticle extends AbstractVerticle {
private VertxServer server;
@Override
public void start(Promise<Void> startPromise) throws Exception {
server = VertxServerBuilder
.forAddress(vertx, vertx.getOrCreateContext().config().getString("internal_ip"),
RPC.AGENT_PORT)
.addService(new AgentServiceImpl(vertx))
.build()
.start(startPromise);
}
@Override
public void stop(Promise<Void> stopPromise) throws Exception {
server.shutdown(stopPromise);
}
}
|