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

xin.alum.aim.handler.AimServerReceiver Maven / Gradle / Ivy

There is a newer version: 1.9.6
Show newest version
package xin.alum.aim.handler;

import xin.alum.aim.constant.ChannelClose;
import xin.alum.aim.socks.SocksHandShake;
import xin.alum.aim.websocks.WebSocketHandShake;
import xin.alum.aim.groups.Session;
import xin.alum.aim.model.Reply;
import xin.alum.aim.model.Sent;
import io.netty.buffer.ByteBuf;

import io.netty.channel.Channel;

import java.io.IOException;

/**
 * @auther alum(alum @ live.cn)
 * @date 2021/8/4 20:08
 */
public interface AimServerReceiver extends WebSocketHandShake, SocksHandShake {

    void onHandShaked(Channel ch);

    /**
     * 收到客户端的Ping操作
     */
    void onPing(Channel ch);

    /**
     * 客户端消息回调
     *
     * @param text
     */
    void onText(Channel ch, String text) throws InterruptedException;

    void onByte(Channel ch, ByteBuf buf) throws IOException;

    /**
     * 接受消息
     *
     * @param msg
     */
    void onRecive(Channel ch, Sent msg);

    /**
     * 处理互踢业务逻辑
     *
     * @param ch
     */
    Reply onKick(Channel ch, Session session);

    /**
     * 关闭连接通道
     *
     * @param ch
     * @param heartbeat
     */
    void onClose(Channel ch, ChannelClose heartbeat);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy