本文整理了Java中org.jboss.netty.channel.Channels.fireChannelUnbound()
方法的一些代码示例,展示了Channels.fireChannelUnbound()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Channels.fireChannelUnbound()
方法的具体详情如下:
包路径:org.jboss.netty.channel.Channels
类名称:Channels
方法名:fireChannelUnbound
[英]Sends a "channelUnbound" event to the first ChannelUpstreamHandler in the ChannelPipeline of the specified Channel.
[中]将“channelUnbound”事件发送到指定通道的ChannelPipeline中的第一个ChannelUpstreamHandler。
代码示例来源:origin: io.netty/netty
@Override
public void channelUnbound(ChannelHandlerContext ctx,
ChannelStateEvent e) throws Exception {
fireChannelUnbound(virtualChannel);
}
代码示例来源:origin: io.netty/netty
fireChannelUnbound(channel);
} else {
fireChannelUnboundLater(channel);
代码示例来源:origin: io.netty/netty
public void run() {
fireChannelUnbound(channel);
}
});
代码示例来源:origin: io.netty/netty
fireChannelUnbound(channel);
} else {
fireChannelUnboundLater(channel);
代码示例来源:origin: io.netty/netty
public boolean finish() {
close(channel);
fireChannelDisconnected(channel);
fireChannelUnbound(channel);
fireChannelClosed(channel);
return !productQueue.isEmpty();
}
代码示例来源:origin: io.netty/netty
private static void close(OioServerSocketChannel channel, ChannelFuture future) {
boolean bound = channel.isBound();
try {
channel.socket.close();
// Make sure the boss thread is not running so that that the future
// is notified after a new connection cannot be accepted anymore.
// See NETTY-256 for more information.
channel.shutdownLock.lock();
try {
if (channel.setClosed()) {
future.setSuccess();
if (bound) {
fireChannelUnbound(channel);
}
fireChannelClosed(channel);
} else {
future.setSuccess();
}
} finally {
channel.shutdownLock.unlock();
}
} catch (Throwable t) {
future.setFailure(t);
fireExceptionCaught(channel, t);
}
}
代码示例来源:origin: io.netty/netty
private static void close(DefaultLocalServerChannel channel, ChannelFuture future) {
try {
if (channel.setClosed()) {
future.setSuccess();
LocalAddress localAddress = channel.localAddress;
if (channel.bound.compareAndSet(true, false)) {
channel.localAddress = null;
LocalChannelRegistry.unregister(localAddress);
fireChannelUnbound(channel);
}
fireChannelClosed(channel);
} else {
future.setSuccess();
}
} catch (Throwable t) {
future.setFailure(t);
fireExceptionCaught(channel, t);
}
}
}
代码示例来源:origin: io.netty/netty
this.pairedChannel = null;
fireChannelDisconnected(this);
fireChannelUnbound(this);
pairedChannel.pairedChannel = null;
fireChannelDisconnected(pairedChannel);
fireChannelUnbound(pairedChannel);
代码示例来源:origin: io.netty/netty
void close(NioServerSocketChannel channel, ChannelFuture future) {
boolean bound = channel.isBound();
try {
channel.socket.close();
increaseCancelledKeys();
if (channel.setClosed()) {
future.setSuccess();
if (bound) {
fireChannelUnbound(channel);
}
fireChannelClosed(channel);
} else {
future.setSuccess();
}
} catch (Throwable t) {
future.setFailure(t);
fireExceptionCaught(channel, t);
}
}
代码示例来源:origin: io.netty/netty
private static void close(NioDatagramChannel channel, ChannelFuture future) {
try {
channel.getDatagramChannel().socket().close();
if (channel.setClosed()) {
future.setSuccess();
if (channel.isBound()) {
fireChannelUnbound(channel);
}
fireChannelClosed(channel);
} else {
future.setSuccess();
}
} catch (final Throwable t) {
future.setFailure(t);
fireExceptionCaught(channel, t);
}
}
代码示例来源:origin: k3po/k3po
@Override
public void run() {
fireChannelUnbound(serverChannel);
unbindFuture.setSuccess();
}
代码示例来源:origin: k3po/k3po
@Override
public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
TlsChildChannel tlsChildChannel = this.tlsChildChannel;
if (tlsChildChannel != null) {
this.tlsChildChannel = null;
if (tlsChildChannel.setReadClosed()) {
fireChannelDisconnected(tlsChildChannel);
fireChannelUnbound(tlsChildChannel);
fireChannelClosed(tlsChildChannel);
}
}
}
代码示例来源:origin: k3po/k3po
@Override
public void operationComplete(ChannelFuture future) throws Exception {
if (tlsClientChannel.setWriteClosed()) {
fireChannelDisconnected(tlsClientChannel);
fireChannelUnbound(tlsClientChannel);
fireChannelClosed(tlsClientChannel);
}
}
};
代码示例来源:origin: k3po/k3po
@Override
public void operationComplete(ChannelFuture future) throws Exception {
if (tlsChildChannel.setWriteClosed()) {
fireChannelDisconnected(tlsChildChannel);
fireChannelUnbound(tlsChildChannel);
fireChannelClosed(tlsChildChannel);
}
}
};
代码示例来源:origin: k3po/k3po
@Override
public void operationComplete(ChannelFuture future) throws Exception {
if (httpChildChannel.setWriteClosed()) {
fireChannelDisconnected(httpChildChannel);
fireChannelUnbound(httpChildChannel);
fireChannelClosed(httpChildChannel);
}
}
});
代码示例来源:origin: k3po/k3po
private static void handleTlsTransportUnbindComplete(
TlsServerChannel tlsUnbindChannel,
ChannelFuture tlsUnbindFuture,
ChannelFuture unbindFuture) {
if (unbindFuture.isSuccess()) {
fireChannelUnbound(tlsUnbindChannel);
tlsUnbindFuture.setSuccess();
}
else {
tlsUnbindFuture.setFailure(unbindFuture.getCause());
}
}
代码示例来源:origin: k3po/k3po
@Override
public void run() {
serverChannel.setClosed();
fireChannelUnbound(serverChannel);
fireChannelClosed(serverChannel);
serverChannel.getCloseFuture().setSuccess();
}
代码示例来源:origin: k3po/k3po
private static void handleHttpTransportUnbindComplete(
HttpServerChannel httpUnbindChannel,
ChannelFuture httpUnbindFuture,
ChannelFuture unbindFuture) {
if (unbindFuture.isSuccess()) {
fireChannelUnbound(httpUnbindChannel);
httpUnbindFuture.setSuccess();
}
else {
httpUnbindFuture.setFailure(unbindFuture.getCause());
}
}
代码示例来源:origin: projectodd/stilts
public boolean finish() {
fireChannelDisconnected( channel );
fireChannelUnbound( channel );
fireChannelClosed( channel );
return !productQueue.isEmpty();
}
代码示例来源:origin: k3po/k3po
@Override
protected void closeRequested(ChannelPipeline pipeline, ChannelStateEvent evt) throws Exception {
UdpServerChannel serverChannel = (UdpServerChannel) evt.getChannel();
// Close underlying NioDatagramChannel
serverChannel.getTransport().close();
// setClosed() (but *not* evt.getFuture().setSuccess()) triggers the ChannelFuture's success
serverChannel.setClosed();
fireChannelDisconnected(serverChannel);
fireChannelUnbound(serverChannel);
fireChannelClosed(serverChannel);
}
内容来源于网络,如有侵权,请联系作者删除!