org.jboss.netty.channel.Channels.fireChannelDisconnected()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(147)

本文整理了Java中org.jboss.netty.channel.Channels.fireChannelDisconnected()方法的一些代码示例,展示了Channels.fireChannelDisconnected()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Channels.fireChannelDisconnected()方法的具体详情如下:
包路径:org.jboss.netty.channel.Channels
类名称:Channels
方法名:fireChannelDisconnected

Channels.fireChannelDisconnected介绍

[英]Sends a "channelDisconnected" event to the first ChannelUpstreamHandler in the ChannelPipeline of the specified Channel.
[中]将“channelDisconnected”事件发送到指定通道的ChannelPipeline中的第一个ChannelUpstreamHandler。

代码示例

代码示例来源:origin: io.netty/netty

@Override
public void channelDisconnected(ChannelHandlerContext ctx,
    ChannelStateEvent e) throws Exception {
  fireChannelDisconnected(virtualChannel);
}

代码示例来源:origin: io.netty/netty

static void disconnect(OioDatagramChannel channel, ChannelFuture future) {
    boolean connected = channel.isConnected();
    boolean iothread = isIoThread(channel);

    try {
      channel.socket.disconnect();
      future.setSuccess();
      if (connected) {
        // Notify.
        if (iothread) {
          fireChannelDisconnected(channel);
        } else {
          fireChannelDisconnectedLater(channel);
        }
      }
    } catch (Throwable t) {
      future.setFailure(t);
      if (iothread) {
        fireExceptionCaught(channel, t);
      } else {
        fireExceptionCaughtLater(channel, t);
      }
    }
  }
}

代码示例来源:origin: io.netty/netty

public void run() {
    fireChannelDisconnected(channel);
  }
});

代码示例来源:origin: io.netty/netty

static void disconnect(NioDatagramChannel channel, ChannelFuture future) {
  boolean connected = channel.isConnected();
  boolean iothread = isIoThread(channel);
  try {
    channel.getDatagramChannel().disconnect();
    future.setSuccess();
    if (connected) {
      if (iothread) {
        fireChannelDisconnected(channel);
      } else {
        fireChannelDisconnectedLater(channel);
      }
    }
  } catch (Throwable t) {
    future.setFailure(t);
    if (iothread) {
      fireExceptionCaught(channel, t);
    } else {
      fireExceptionCaughtLater(channel, t);
    }
  }
}

代码示例来源:origin: io.netty/netty

public boolean finish() {
  close(channel);
  fireChannelDisconnected(channel);
  fireChannelUnbound(channel);
  fireChannelClosed(channel);
  return !productQueue.isEmpty();
}

代码示例来源:origin: io.netty/netty

fireChannelDisconnected(channel);
} else {
  fireChannelDisconnectedLater(channel);

代码示例来源:origin: io.netty/netty

if (pairedChannel != null) {
  this.pairedChannel = null;
  fireChannelDisconnected(this);
  fireChannelUnbound(this);
if (me != null) {
  pairedChannel.pairedChannel = null;
  fireChannelDisconnected(pairedChannel);
  fireChannelUnbound(pairedChannel);

代码示例来源:origin: io.netty/netty

if (connected) {
  if (iothread) {
    fireChannelDisconnected(channel);
  } else {
    fireChannelDisconnectedLater(channel);

代码示例来源: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

@Override
  public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
    TlsClientChannel tlsClientChannel = this.tlsClientChannel;
    if (tlsClientChannel != null) {

      this.tlsClientChannel = null;

      if (tlsClientChannel.setReadClosed()) {
        fireChannelDisconnected(tlsClientChannel);
        fireChannelUnbound(tlsClientChannel);
        fireChannelClosed(tlsClientChannel);
      }
    }
  }
}

代码示例来源:origin: projectodd/stilts

public boolean finish() {
  fireChannelDisconnected( channel );
  fireChannelUnbound( channel );
  fireChannelClosed( channel );
  return !productQueue.isEmpty();
}

代码示例来源:origin: k3po/k3po

@Override
  public void operationComplete(ChannelFuture future) throws Exception {
    if (tlsClientChannel.setWriteClosed()) {
      fireOutputShutdown(tlsClientChannel);
      fireChannelDisconnected(tlsClientChannel);
      fireChannelUnbound(tlsClientChannel);
      fireChannelClosed(tlsClientChannel);
    }
    else {
      fireOutputShutdown(tlsClientChannel);
    }
  }
});

代码示例来源:origin: k3po/k3po

@Override
  public void operationComplete(ChannelFuture future) throws Exception {
    if (tlsChildChannel.setWriteClosed()) {
      fireOutputShutdown(tlsChildChannel);
      fireChannelDisconnected(tlsChildChannel);
      fireChannelUnbound(tlsChildChannel);
      fireChannelClosed(tlsChildChannel);
    }
    else {
      fireOutputShutdown(tlsChildChannel);
    }
  }
});

代码示例来源:origin: k3po/k3po

@Override
public void inputShutdown(ChannelHandlerContext ctx, ShutdownInputEvent e) {
  TlsChildChannel tlsChildChannel = this.tlsChildChannel;
  if (tlsChildChannel != null) {
    if (tlsChildChannel.setReadClosed()) {
      fireInputShutdown(tlsChildChannel);
      fireChannelDisconnected(tlsChildChannel);
      fireChannelUnbound(tlsChildChannel);
      fireChannelClosed(tlsChildChannel);
    }
    else {
      fireInputShutdown(tlsChildChannel);
    }
  }
}

代码示例来源:origin: k3po/k3po

@Override
  public void operationComplete(ChannelFuture future) throws Exception {
    if (tlsChildChannel.setReadClosed()) {
      fireInputShutdown(tlsChildChannel);
      fireChannelDisconnected(tlsChildChannel);
      fireChannelUnbound(tlsChildChannel);
      fireChannelClosed(tlsChildChannel);
    }
    else
    {
      fireInputShutdown(tlsChildChannel);
    }
  }
});

代码示例来源: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);
}

代码示例来源:origin: k3po/k3po

@Override
protected void closeRequested(ChannelPipeline pipeline, ChannelStateEvent evt) throws Exception {
  final UdpChildChannel channel = (UdpChildChannel) evt.getChannel();
  if (channel.isConnected()) {
    childChannelSource.closeChildChannel(channel);
  }
  if (channel.setClosed())
  {
    fireChannelDisconnected(channel);
    fireChannelUnbound(channel);
    fireChannelClosed(channel);
  }
  evt.getFuture().setSuccess();
}

相关文章