@Override public void operationComplete(ChannelFuture future) throws Exception { Channel ch = future.channel(); if (!future.isSuccess()) { failInit(ch, toIOE(future.cause())); rpcClient.failedServers.addToFailedServers(remoteId.address, future.cause()); return; } ch.writeAndFlush(connectionHeaderPreamble.retainedDuplicate()); if (useSasl) { saslNegotiate(ch); } else { // send the connection header to server ch.write(connectionHeaderWithLength.retainedDuplicate()); established(ch); } } }).channel();
} else { ch.write(connectionHeaderWithLength.retainedDuplicate()); established(ch);
} else { ch.write(connectionHeaderWithLength.retainedDuplicate()); established(ch);
@Override public void operationComplete(ChannelFuture future) throws Exception { Channel ch = future.channel(); if (!future.isSuccess()) { failInit(ch, toIOE(future.cause())); rpcClient.failedServers.addToFailedServers(remoteId.address, future.cause()); return; } ch.writeAndFlush(connectionHeaderPreamble.retainedDuplicate()); if (useSasl) { saslNegotiate(ch); } else { // send the connection header to server ch.write(connectionHeaderWithLength.retainedDuplicate()); established(ch); } } }).channel();
@Override public ChannelGroupFuture write(Object message, ChannelMatcher matcher, boolean voidPromise) { if (message == null) { throw new NullPointerException("message"); } if (matcher == null) { throw new NullPointerException("matcher"); } final ChannelGroupFuture future; if (voidPromise) { for (Channel c: nonServerChannels.values()) { if (matcher.matches(c)) { c.write(safeDuplicate(message), c.voidPromise()); } } future = voidFuture; } else { Map<Channel, ChannelFuture> futures = new LinkedHashMap<Channel, ChannelFuture>(size()); for (Channel c: nonServerChannels.values()) { if (matcher.matches(c)) { futures.put(c, c.write(safeDuplicate(message))); } } future = new DefaultChannelGroupFuture(this, futures, executor); } ReferenceCountUtil.release(message); return future; }
@Override public void operationComplete(ChannelFuture future) throws Exception { Channel ch = future.channel(); if (!future.isSuccess()) { failInit(ch, toIOE(future.cause())); rpcClient.failedServers.addToFailedServers(remoteId.address, future.cause()); return; } ch.writeAndFlush(connectionHeaderPreamble.retainedDuplicate()); if (useSasl) { saslNegotiate(ch); } else { // send the connection header to server ch.write(connectionHeaderWithLength.retainedDuplicate()); established(ch); } } }).channel();
} else { ch.write(connectionHeaderWithLength.retainedDuplicate()); established(ch);