public static ChannelFuture connect(PeerAddress peerAddress, byte[] hashinfo) throws InterruptedException { if (bootstrap == null) { init(); } bootstrap.handler(HandlerFactory.client(hashinfo)); ChannelFuture channelFuture = bootstrap.connect(peerAddress.getAddress(), peerAddress.getPort()).sync(); register(peerAddress, channelFuture.channel()); return channelFuture; }