Uses of Class
org.aoju.bus.socket.AioSession
Packages that use AioSession
Package
Description
定义用户进行通信开发所需实现的接口
提供插件等实现
消息处理器
-
Uses of AioSession in org.aoju.bus.socket
Subclasses of AioSession in org.aoju.bus.socketModifier and TypeClassDescriptionclassAIO传输层会话 AioSession为smart-socket最核心的类,封装AsynchronousSocketChannelAPI接口,简化IO操作 其中开放给用户使用的接口为:close()TcpAioSession.close(boolean)getAttachment()TcpAioSession.getInputStream()TcpAioSession.getInputStream(int)TcpAioSession.getLocalAddress()TcpAioSession.getRemoteAddress()TcpAioSession.getSessionID()TcpAioSession.isInvalid()setAttachment(Object)classMethods in org.aoju.bus.socket that return AioSessionModifier and TypeMethodDescriptionUdpChannel.connect(SocketAddress remote) 建立与远程服务的连接会话,通过AioSession可进行数据传输final AioSessionAioQuickClient.start()启动客户端。AioQuickClient.start(AsynchronousChannelGroup asynchronousChannelGroup) 启动客户端。Methods in org.aoju.bus.socket with parameters of type AioSessionModifier and TypeMethodDescriptionvoidNetMonitor.afterRead(AioSession session, int readSize) 监控触发本次读回调Session的已读数据字节数voidNetMonitor.afterWrite(AioSession session, int writeSize) 监控触发本次写回调session的已写数据字节数voidNetMonitor.beforeRead(AioSession session) 即将开始读取数据voidNetMonitor.beforeWrite(AioSession session) 即将开始写数据Protocol.decode(ByteBuffer readBuffer, AioSession session) 对于从Socket流中获取到的数据采用当前Protocol的实现类协议进行解析。voidGroupIo.join(String group, AioSession session) 将AioSession加入群组groupvoidGroupIo.remove(String group, AioSession session) 将AioSession从群众group中移除voidGroupIo.remove(AioSession session) AioSession从所有群组中退出Method parameters in org.aoju.bus.socket with type arguments of type AioSessionModifier and TypeMethodDescription<A> voidAioQuickClient.start(A attachment, CompletionHandler<AioSession, ? super A> handler) 采用异步的方式启动客户端<A> voidAioQuickClient.start(AsynchronousChannelGroup asynchronousChannelGroup, A attachment, CompletionHandler<AioSession, ? super A> handler) 采用异步的方式启动客户端 -
Uses of AioSession in org.aoju.bus.socket.plugins
Methods in org.aoju.bus.socket.plugins with parameters of type AioSessionModifier and TypeMethodDescriptionvoidAbstractPlugin.afterRead(AioSession session, int readSize) voidMonitorPlugin.afterRead(AioSession session, int readSize) voidAbstractPlugin.afterWrite(AioSession session, int writeSize) voidMonitorPlugin.afterWrite(AioSession session, int writeSize) voidAbstractPlugin.beforeRead(AioSession session) voidMonitorPlugin.beforeRead(AioSession session) voidAbstractPlugin.beforeWrite(AioSession session) voidMonitorPlugin.beforeWrite(AioSession session) voidHeartPlugin.TimeoutCallback.callback(AioSession session, long lastTime) abstract booleanHeartPlugin.isHeartMessage(AioSession session, T msg) 判断当前收到的消息是否为心跳消息。booleanAbstractPlugin.preProcess(AioSession session, T t) final booleanHeartPlugin.preProcess(AioSession session, T t) booleanMonitorPlugin.preProcess(AioSession session, T t) booleanPlugin.preProcess(AioSession session, T t) 对请求消息进行预处理,并决策是否进行后续的MessageProcessor处理 若返回false,则当前消息将被忽略 若返回true,该消息会正常秩序MessageProcessor.process.abstract voidHeartPlugin.sendHeartRequest(AioSession session) 自定义心跳消息并发送voidAbstractPlugin.stateEvent(SocketStatus socketStatus, AioSession session, Throwable throwable) final voidHeartPlugin.stateEvent(SocketStatus socketStatus, AioSession session, Throwable throwable) voidMonitorPlugin.stateEvent(SocketStatus socketStatus, AioSession session, Throwable throwable) voidPlugin.stateEvent(SocketStatus socketStatus, AioSession session, Throwable throwable) 监听状态机事件voidReconnectPlugin.stateEvent(SocketStatus socketStatus, AioSession session, Throwable throwable) -
Uses of AioSession in org.aoju.bus.socket.process
Methods in org.aoju.bus.socket.process with parameters of type AioSessionModifier and TypeMethodDescriptionfinal voidAbstractMessageProcessor.afterRead(AioSession session, int readSize) final voidAbstractMessageProcessor.afterWrite(AioSession session, int writeSize) final voidAbstractMessageProcessor.beforeRead(AioSession session) final voidAbstractMessageProcessor.beforeWrite(AioSession session) final voidGroupMessageProcessor.join(String group, AioSession session) 将AioSession加入群组groupfinal voidAbstractMessageProcessor.process(AioSession session, T msg) voidMessageProcessor.process(AioSession session, T msg) 处理接收到的消息abstract voidAbstractMessageProcessor.process0(AioSession session, T msg) 处理接收到的消息final voidGroupMessageProcessor.remove(String group, AioSession session) final voidGroupMessageProcessor.remove(AioSession session) final voidAbstractMessageProcessor.stateEvent(AioSession session, SocketStatus socketStatus, Throwable throwable) default voidMessageProcessor.stateEvent(AioSession session, SocketStatus socketStatus, Throwable throwable) 状态机事件,当枚举事件发生时由框架触发该方法abstract voidAbstractMessageProcessor.stateEvent0(AioSession session, SocketStatus socketStatus, Throwable throwable) -
Uses of AioSession in org.aoju.bus.socket.protocol
Methods in org.aoju.bus.socket.protocol with parameters of type AioSessionModifier and TypeMethodDescriptionprotected byte[]ByteArrayProtocol.decode(byte[] bytes, AioSession session) protected abstract TFixedLengthBytesProtocol.decode(byte[] bytes, AioSession session) final TFixedLengthBytesProtocol.decode(ByteBuffer readBuffer, AioSession session) StringProtocol.decode(ByteBuffer readBuffer, AioSession session)