public void operationComplete(ChannelFuture future) throws Exception { if (!future.isSuccess()) { Channel channel = future.getChannel(); issueSessionError( context, channel, remoteAddress, SpdySessionStatus.INTERNAL_ERROR); } } });
public void operationComplete(ChannelFuture future) throws Exception { if (!future.isSuccess()) { Channel channel = future.getChannel(); issueSessionError( context, channel, remoteAddress, SpdySessionStatus.INTERNAL_ERROR); } } });
public void operationComplete(ChannelFuture future) throws Exception { if (!future.isSuccess()) { Channel channel = future.getChannel(); issueSessionError(context, channel, remoteAddress, SpdySessionStatus.INTERNAL_ERROR); } } });
public void operationComplete(ChannelFuture future) throws Exception { if (!future.isSuccess()) { Channel channel = future.getChannel(); issueSessionError(context, channel, remoteAddress, SpdySessionStatus.INTERNAL_ERROR); } } });
public void operationComplete(ChannelFuture future) throws Exception { remove(future.getChannel()); } };
public void operationComplete(ChannelFuture future) throws Exception { remove(future.getChannel()); } };
public void operationComplete(ChannelFuture future) { future.getChannel().close(); } };
@Override public void operationComplete(ChannelFuture future) throws Exception { if (future.isSuccess()) { future.getChannel().write(loginEvent); } else { throw new RuntimeException(future.getCause() .getMessage()); } } });
@Override public void close(ChannelFuture resource) { log.trace("Closing"); resource.awaitUninterruptibly().getChannel().close(); } }
public void operationComplete(ChannelFuture future) { if (!future.isSuccess()) { future.getChannel().close(); } } };
public void operationComplete(ChannelFuture future) throws Exception { pendings.decrementAndGet(); if (!future.isSuccess()) { Channel channel = future.getChannel(); if (!isClosed()) { LOG.info("Failed to send requests to " + name + ": " + channel.toString() + ":", future.getCause()); } if (null != channel) { exceptionChannel(channel); } } } });
@Override public void operationComplete(ChannelFuture future) throws Exception { if (!future.isSuccess()) { // On error close the channel. future.getChannel().close(); return; } // Entire response is written out. Safe to enable timeout handling. timeoutHandler.setEnabledTimeout(true); } });
public void operationComplete(ChannelFuture future) throws Exception { if (!future.isSuccess()) { Channels.fireExceptionCaught(future.getChannel(), future.getCause()); } } };
public Future<ServerInfoMessage> requestInfo(final String address, final int port) { return pool.submit(() -> { InetSocketAddress remoteAddress = new InetSocketAddress(address, port); ChannelFuture connectCheck = bootstrap.connect(remoteAddress); connectCheck.syncUninterruptibly(); Channel channel = connectCheck.getChannel(); channel.getCloseFuture().syncUninterruptibly(); ServerInfoRequestHandler handler = channel.getPipeline().get(ServerInfoRequestHandler.class); ServerInfoMessage serverInfo = handler.getServerInfo(); return serverInfo; }); }
@Override public boolean isGood(ChannelFuture resource) { Channel channel = resource.awaitUninterruptibly().getChannel(); boolean isSuccess = resource.isSuccess(); boolean isConnected = channel.isConnected(); boolean isOpen = channel.isOpen(); if (log.isTraceEnabled()) { log.trace("isGood = isSucess[%s] && isConnected[%s] && isOpen[%s]", isSuccess, isConnected, isOpen); } return isSuccess && isConnected && isOpen; }
/** * Creates a new channel which is bound to the specified local address. This operation will block until * the channel is bound. * * @return a new bound channel which accepts incoming connections * * @throws ChannelException * if failed to create a new channel and * bind it to the local address */ public Channel bind(final SocketAddress localAddress) { ChannelFuture future = bindAsync(localAddress); // Wait for the future. future.awaitUninterruptibly(); if (!future.isSuccess()) { future.getChannel().close().awaitUninterruptibly(); throw new ChannelException("Failed to bind to: " + localAddress, future.getCause()); } return future.getChannel(); }
public void operationComplete(ChannelFuture future) throws Exception { if (future.isSuccess()) { bfuture.setSuccess(); } else { // Call close on bind failure bfuture.getChannel().close(); bfuture.setFailure(future.getCause()); } } });
channel = channelFuture.getChannel(); if (channel.getLocalAddress() != null && channel.getLocalAddress() instanceof InetSocketAddress) { localAddress = (InetSocketAddress) channel.getLocalAddress(); if(channelFuture.getChannel() != null){ connected = channelFuture.getChannel().isConnected(); } catch (Exception e) { if (channelFuture != null) { channelFuture.getChannel().close();
Channel newChannel = future.getChannel(); newChannel.setInterestOps(Channel.OP_READ_WRITE); try {
Channel newChannel = future.getChannel(); newChannel.setInterestOps(Channel.OP_READ_WRITE); try {