xin.alum.aim.handler.AimServerReceiver Maven / Gradle / Ivy
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);
}