io.netty.channel.ChannelOutboundInvoker Java Examples

The following examples show how to use io.netty.channel.ChannelOutboundInvoker. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: OFSwitchManager.java    From onos with Apache License 2.0 5 votes vote down vote up
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);
}
 
Example #2
Source File: OFSwitchManager.java    From onos with Apache License 2.0 5 votes vote down vote up
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);
}
 
Example #3
Source File: MultiplexedChannelRecord.java    From aws-sdk-java-v2 with Apache License 2.0 4 votes vote down vote up
/**
 * Close all registered child channels, and prohibit new streams from being created on this connection.
 */
void closeChildChannels() {
    closeAndExecuteOnChildChannels(ChannelOutboundInvoker::close);
}
 
Example #4
Source File: MultiplexedChannelRecord.java    From ambry with Apache License 2.0 4 votes vote down vote up
/**
 * Close all registered child channels, and prohibit new streams from being created on this connection.
 */
void closeChildChannels() {
  closeAndExecuteOnChildChannels(ChannelOutboundInvoker::close);
}
 
Example #5
Source File: TcpPresenter.java    From ClusterDeviceControlPlatform with MIT License 2 votes vote down vote up
/**
 * 主动断开特定 Channel 的连接
 *
 * @param i Channel 的 ID
 */
public void removeChannel(int i) {
    touchChannel(i).ifPresent(ChannelOutboundInvoker::disconnect);
}