use of org.apache.ratis.thirdparty.io.netty.handler.logging.LoggingHandler in project incubator-ratis by apache.
the class NettyClient method connect.
/**
* Connects to the given server address.
*/
public void connect(String serverAddress, EventLoopGroup group, ChannelInitializer<SocketChannel> initializer) throws InterruptedException {
final InetSocketAddress address = NetUtils.createSocketAddr(serverAddress);
lifeCycle.startAndTransition(() -> channel = new Bootstrap().group(group).channel(NioSocketChannel.class).handler(new LoggingHandler(LogLevel.INFO)).handler(initializer).connect(address).sync().channel(), InterruptedException.class);
}
Aggregations