类io.netty.channel.ChannelOutboundInvoker源码实例Demo

下面列出了怎么用io.netty.channel.ChannelOutboundInvoker的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: onos   文件: OFSwitchManager.java
private void deleteOFSwitch(DeviceId deviceId) {
    OFSwitch ofSwitch = ofSwitchMap.get(deviceId);
    ofSwitch.controllerChannels().forEach(ChannelOutboundInvoker::disconnect);

    ofSwitchMap.remove(deviceId);
    log.info("Removed virtual OFSwitch for {}", deviceId);
}
 
源代码2 项目: onos   文件: OFSwitchManager.java
private void disconnectController(OFSwitch ofSwitch, Set<OFController> controllers) {
    Set<SocketAddress> controllerAddrs = controllers.stream()
            .map(ctrl -> new InetSocketAddress(
                    ctrl.ip().toInetAddress(), ctrl.port().toInt()))
            .collect(Collectors.toSet());

    ofSwitch.controllerChannels().stream()
            .filter(channel -> controllerAddrs.contains(channel.remoteAddress()))
            .forEach(ChannelOutboundInvoker::disconnect);
}
 
/**
 * Close all registered child channels, and prohibit new streams from being created on this connection.
 */
void closeChildChannels() {
    closeAndExecuteOnChildChannels(ChannelOutboundInvoker::close);
}
 
源代码4 项目: ambry   文件: MultiplexedChannelRecord.java
/**
 * Close all registered child channels, and prohibit new streams from being created on this connection.
 */
void closeChildChannels() {
  closeAndExecuteOnChildChannels(ChannelOutboundInvoker::close);
}
 
/**
 * 主动断开特定 Channel 的连接
 *
 * @param i Channel 的 ID
 */
public void removeChannel(int i) {
    touchChannel(i).ifPresent(ChannelOutboundInvoker::disconnect);
}
 
 类所在包
 类方法
 同包方法