public synchronized boolean isChannelReadable(String remoteAddress) { Channel ch = channelMap.get(remoteAddress); if (ch != null) { return ch.isReadable(); } else { return false; } }
if (!channel.isReadable() && ! rws.readSuspend) { logger.debug("Not unsuspend: " + channel.isReadable() + ':' + rws.readSuspend); if (channel.isReadable() && rws.readSuspend) { logger.debug("Unsuspend: " + channel.isReadable() + ':' + rws.readSuspend); } else { logger.debug("Normal unsuspend: " + channel.isReadable() + ':' + rws.readSuspend); logger.debug("Unsupsend final status => " + channel.isReadable() + ':' + rws.readSuspend);
logger.debug("Read suspend: " + wait + ':' + channel.isReadable() + ':' + rws.readSuspend); return; if (channel.isReadable() && ! rws.readSuspend) { rws.readSuspend = true; channel.setReadable(false); if (logger.isDebugEnabled()) { logger.debug("Suspend final status => " + channel.isReadable() + ':' + rws.readSuspend);
logger.debug("Read suspend: " + wait + ':' + channel.isReadable() + ':' + rws.readSuspend); return; if (channel.isReadable() && ! rws.readSuspend) { rws.readSuspend = true; channel.setReadable(false); if (logger.isDebugEnabled()) { logger.debug("Suspend final status => " + channel.isReadable() + ':' + rws.readSuspend);
if (channel.isReadable()) {
if (!channel.isReadable()) {
public final void tryToOfferChannelToPool(Channel channel, boolean keepAlive, Object partitionKey) { if (channel.isConnected() && keepAlive && channel.isReadable()) { LOGGER.debug("Adding key: {} for channel {}", partitionKey, channel); Channels.setDiscard(channel); if (channelPool.offer(channel, partitionKey)) { if (maxConnectionsPerHostEnabled) channelId2PartitionKey.putIfAbsent(channel.getId(), partitionKey); } else { // rejected by pool closeChannel(channel); } } else { // not offered closeChannel(channel); } }
@Override public boolean isReadable() { return channel.isReadable(); }
@Override public boolean isReadable() { return channel.isReadable(); }
@Override public boolean isReadSuspended() { return channel.isReadable(); }
public synchronized boolean isChannelReadable(String remoteAddress) { Channel ch = channelMap.get(remoteAddress); if (ch != null) { return ch.isReadable(); } else { return false; } }
public boolean isClosed() { return (null == channel) || !channel.isConnected() || !channel.isReadable() || !channel.isWritable(); }
public final void tryToOfferChannelToPool(Channel channel, boolean keepAlive, String poolKey) { if (keepAlive && channel.isReadable()) { LOGGER.debug("Adding key: {} for channel {}", poolKey, channel); channelPool.offer(channel, poolKey); if (maxConnectionsPerHostEnabled) channelId2KeyPool.putIfAbsent(channel.getId(), poolKey); Channels.setDiscard(channel); } else { // not offered closeChannel(channel); } }
@Override protected void invokeCommand(final ChannelHandlerContext ctx) throws Exception { Channel channel = ctx.getChannel(); if (channel.isReadable()) { invokeCommandWhenReadable(ctx); } else { readableFuture.addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { if (future.isSuccess()) { invokeCommandWhenReadable(ctx); } } }); } }
public final void tryToOfferChannelToPool(Channel channel, boolean keepAlive, Object partitionKey) { if (channel.isConnected() && keepAlive && channel.isReadable()) { LOGGER.debug("Adding key: {} for channel {}", partitionKey, channel); Channels.setDiscard(channel); channelPool.offer(channel, partitionKey); if (maxConnectionsPerHostEnabled) channelId2PartitionKey.putIfAbsent(channel.getId(), partitionKey); } else { // not offered closeChannel(channel); } }
@Override public void messageReceived(final ChannelHandlerContext ctx, final MessageEvent evt) throws Exception { /* Get audio channel from the enclosing RaopAudioHandler */ Channel audioChannel = null; synchronized(RaopAudioHandler.this) { audioChannel = m_audioChannel; } if ((m_audioChannel != null) && m_audioChannel.isOpen() && m_audioChannel.isReadable()) { audioChannel.getPipeline().sendUpstream(new UpstreamMessageEvent( audioChannel, evt.getMessage(), evt.getRemoteAddress()) ); } } }
public final void tryToOfferChannelToPool(Channel channel, AsyncHandler<?> handler, boolean keepAlive, Object partitionKey) { if (channel.isConnected() && keepAlive && channel.isReadable()) { LOGGER.debug("Adding key: {} for channel {}", partitionKey, channel); Channels.setDiscard(channel); if (handler instanceof AsyncHandlerExtensions) { AsyncHandlerExtensions.class.cast(handler).onConnectionOffer(channel); } channelPool.offer(channel, partitionKey); if (maxConnectionsPerHostEnabled) channelId2PartitionKey.putIfAbsent(channel.getId(), partitionKey); } else { // not offered closeChannel(channel); } }