use of org.mobicents.tools.heartbeat.packets.LBShutdownRequestPacket in project load-balancer by RestComm.
the class Server method sendPacket.
@Override
public void sendPacket(String command, String host, int port) {
this.nioClientSocketChannelFactory = new NioClientSocketChannelFactory(executor, executor);
this.clientBootstrap = new ClientBootstrap(nioClientSocketChannelFactory);
this.clientBootstrap.setPipelineFactory(new ClientPipelineFactory(serverListener));
future = clientBootstrap.connect(new InetSocketAddress(host, port));
switch(command) {
case Protocol.STOP:
packet = new LBShutdownRequestPacket(lbAddress.getHostAddress(), lbPort);
break;
}
future.awaitUninterruptibly();
future.getChannel().write(createRequest(command));
}
Aggregations