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

io.github.duoduobabi.iproxy.Interceptor Maven / Gradle / Ivy

package io.github.duoduobabi.iproxy;

import io.netty.channel.Channel;

/**
 * 拦截器
 *
 * @author cuiyang
 */
public interface Interceptor extends ProxyConfigHolder {

    /**
     * 拦截消息
     * @param connection 消息所属连接
     * @param msg 消息
     */
    void intercept(Connection connection, Object msg);

    /**
     * 异常捕获
     * @param connection 异常所属连接
     * @param throwable 异常
     */
    void exception(Connection connection, Throwable throwable);

    /**
     * 客户端连接关闭通知
     * @param connection 要关闭的连接
     * @param channel 客户端Channel
     */
    void closeClient(Connection connection, Channel channel);

    /**
     * 服务端连接关闭通知
     * @param connection 要关闭的连接
     * @param channel 服务端Channel
     */
    void closeServer(Connection connection, Channel channel);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy