All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.alibaba.arthas.tunnel.server.ChannelUtils Maven / Gradle / Ivy

package com.alibaba.arthas.tunnel.server;

import io.netty.buffer.Unpooled;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFutureListener;

public final class ChannelUtils {

    /**
     * Closes the specified channel after all queued write requests are flushed.
     */
    public static void closeOnFlush(Channel ch) {
        if (ch.isActive()) {
            ch.writeAndFlush(Unpooled.EMPTY_BUFFER).addListener(ChannelFutureListener.CLOSE);
        }
    }

    private ChannelUtils() {
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy