| 限定符和类型 | 类和说明 |
|---|---|
class |
ClientChannelContext |
| 限定符和类型 | 字段和说明 |
|---|---|
Set<ChannelContext> |
TioClientConfig.closeds |
Set<ChannelContext> |
TioClientConfig.connecteds |
| 限定符和类型 | 方法和说明 |
|---|---|
static ReconnConf |
ReconnConf.getReconnConf(ChannelContext channelContext) |
| 限定符和类型 | 方法和说明 |
|---|---|
Packet |
TioClientHandler.heartbeatPacket(ChannelContext channelContext)
创建心跳包
|
| 限定符和类型 | 字段和说明 |
|---|---|
Set<ChannelContext> |
TioConfig.connections |
| 限定符和类型 | 方法和说明 |
|---|---|
static ChannelContext |
Tio.getByBsId(TioConfig tioConfig,
String bsId)
根据业务id找ChannelContext
|
static ChannelContext |
Tio.getByChannelContextId(TioConfig tioConfig,
String channelContextId)
根据ChannelContext.id获取ChannelContext
|
static ChannelContext |
Tio.getByClientNode(TioConfig tioConfig,
Node node)
根据clientip和clientport获取ChannelContext
|
static ChannelContext |
Tio.getByClientNode(TioConfig tioConfig,
String clientIp,
Integer clientPort)
根据clientip和clientport获取ChannelContext
|
| 限定符和类型 | 方法和说明 |
|---|---|
static Set<ChannelContext> |
Tio.getAll(TioConfig tioConfig)
获取所有连接,包括当前处于断开状态的
|
static Set<ChannelContext> |
Tio.getByGroup(TioConfig tioConfig,
String group)
获取一个组的所有客户端
|
static Set<ChannelContext> |
Tio.getByToken(TioConfig tioConfig,
String token)
根据token获取SetWithLock
|
static Set<ChannelContext> |
Tio.getByUserid(TioConfig tioConfig,
String userid)
根据userid获取SetWithLock
|
static Set<ChannelContext> |
Tio.getConnecteds(TioClientConfig tioClientConfig)
此API仅供 tio client使用
获取所有处于正常连接状态的连接
|
static Page<ChannelContext> |
Tio.getPageOfAll(TioConfig tioConfig,
Integer pageIndex,
Integer pageSize)
服务端,获取所有的连接
|
static Page<ChannelContext> |
Tio.getPageOfConnecteds(TioClientConfig tioClientConfig,
Integer pageIndex,
Integer pageSize)
这个方法是给客户器端用的
|
static Page<ChannelContext> |
Tio.getPageOfGroup(TioConfig tioConfig,
String group,
Integer pageIndex,
Integer pageSize) |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
Tio.bindBsId(ChannelContext channelContext,
String bsId)
绑定业务id
|
static void |
Tio.bindGroup(ChannelContext channelContext,
String group)
绑定群组
|
static void |
Tio.bindToken(ChannelContext channelContext,
String token)
绑定token
|
static void |
Tio.bindUser(ChannelContext channelContext,
String userid)
绑定用户
|
static boolean |
Tio.bSend(ChannelContext channelContext,
Packet packet)
阻塞发送消息到指定ChannelContext
|
static void |
Tio.close(ChannelContext channelContext,
String remark)
关闭连接
|
static void |
Tio.close(ChannelContext channelContext,
String remark,
ChannelContext.CloseCode closeCode) |
static void |
Tio.close(ChannelContext channelContext,
Throwable throwable,
String remark)
关闭连接
|
static void |
Tio.close(ChannelContext channelContext,
Throwable throwable,
String remark,
boolean isNeedRemove) |
static void |
Tio.close(ChannelContext channelContext,
Throwable throwable,
String remark,
boolean isNeedRemove,
boolean needCloseLock) |
static void |
Tio.close(ChannelContext channelContext,
Throwable throwable,
String remark,
boolean isNeedRemove,
boolean needCloseLock,
ChannelContext.CloseCode closeCode) |
static void |
Tio.close(ChannelContext channelContext,
Throwable throwable,
String remark,
boolean isNeedRemove,
ChannelContext.CloseCode closeCode) |
static void |
Tio.close(ChannelContext channelContext,
Throwable throwable,
String remark,
ChannelContext.CloseCode closeCode) |
Packet |
PacketConverter.convert(Packet packet,
ChannelContext channelContext) |
boolean |
ChannelContextFilter.filter(ChannelContext channelContext)
过滤ChannelContext
|
static boolean |
Tio.isInGroup(String group,
ChannelContext channelContext)
某通道是否在某群组中
|
static void |
Tio.remove(ChannelContext channelContext,
String remark)
和close方法对应,只不过不再进行重连等维护性的操作
|
static void |
Tio.remove(ChannelContext channelContext,
String remark,
ChannelContext.CloseCode closeCode)
和close方法对应,只不过不再进行重连等维护性的操作
|
static void |
Tio.remove(ChannelContext channelContext,
Throwable throwable,
String remark)
和close方法对应,只不过不再进行重连等维护性的操作
|
static void |
Tio.remove(ChannelContext channelContext,
Throwable throwable,
String remark,
ChannelContext.CloseCode closeCode)
和close方法对应,只不过不再进行重连等维护性的操作
|
static boolean |
Tio.send(ChannelContext channelContext,
Packet packet)
发送消息到指定ChannelContext
|
static void |
Tio.unbindBsId(ChannelContext channelContext)
解绑业务id
|
static void |
Tio.unbindGroup(ChannelContext channelContext)
与所有组解除解绑关系
|
static void |
Tio.unbindGroup(String group,
ChannelContext channelContext)
与指定组解除绑定关系
|
static void |
Tio.unbindToken(ChannelContext channelContext)
解除channelContext绑定的token
|
static void |
Tio.unbindUser(ChannelContext channelContext)
解除channelContext绑定的userid
|
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
Tio.bSendToSet(TioConfig tioConfig,
Set<ChannelContext> set,
Packet packet,
ChannelContextFilter channelContextFilter)
发消息到指定集合
|
static void |
Tio.closeSet(Set<ChannelContext> set,
String remark,
ChannelContext.CloseCode closeCode)
关闭集合
|
static <T> Page<T> |
Tio.getPageOfAll(TioConfig tioConfig,
Integer pageIndex,
Integer pageSize,
Function<ChannelContext,T> converter)
服务端,获取所有的连接
|
static <T> Page<T> |
Tio.getPageOfAll(TioConfig tioConfig,
Integer pageIndex,
Integer pageSize,
Predicate<ChannelContext> filter,
Function<ChannelContext,T> converter)
服务端,获取所有的连接
|
static <T> Page<T> |
Tio.getPageOfAll(TioConfig tioConfig,
Integer pageIndex,
Integer pageSize,
Predicate<ChannelContext> filter,
Function<ChannelContext,T> converter)
服务端,获取所有的连接
|
static <T> Page<T> |
Tio.getPageOfConnecteds(TioClientConfig tioClientConfig,
Integer pageIndex,
Integer pageSize,
Function<ChannelContext,T> converter)
这个方法是给客户器端用的
|
static <T> Page<T> |
Tio.getPageOfGroup(TioConfig tioConfig,
String group,
Integer pageIndex,
Integer pageSize,
Function<ChannelContext,T> converter) |
static void |
Tio.removeSet(Set<ChannelContext> set,
String remark,
ChannelContext.CloseCode closeCode)
移除集合
|
static void |
Tio.sendToSet(TioConfig tioConfig,
Set<ChannelContext> set,
Packet packet,
ChannelContextFilter channelContextFilter)
发消息到指定集合
|
| 构造器和说明 |
|---|
ReadCompletionHandler(ChannelContext channelContext) |
WriteCompletionHandler(ChannelContext channelContext) |
| 限定符和类型 | 方法和说明 |
|---|---|
Packet |
TioHandler.decode(ByteBuffer buffer,
int limit,
int position,
int readableLength,
ChannelContext channelContext)
根据ByteBuffer解码成业务需要的Packet对象.
|
ByteBuffer |
TioHandler.encode(Packet packet,
TioConfig tioConfig,
ChannelContext channelContext)
编码
|
void |
TioHandler.handler(Packet packet,
ChannelContext channelContext)
处理消息包
|
default void |
GroupListener.onAfterBind(ChannelContext channelContext,
String group)
绑定群组后回调该方法
|
default void |
TioListener.onAfterConnected(ChannelContext channelContext,
boolean isConnected,
boolean isReconnect)
建链后触发本方法,注:建链不一定成功,需要关注参数isConnected
|
default void |
TioListener.onAfterDecoded(ChannelContext channelContext,
Packet packet,
int packetSize)
原方法名:onAfterDecoded
解码成功后触发本方法
|
default void |
TioListener.onAfterHandled(ChannelContext channelContext,
Packet packet,
long cost)
处理一个消息包后
|
default void |
TioListener.onAfterReceivedBytes(ChannelContext channelContext,
int receivedBytes)
接收到TCP层传过来的数据后
|
default void |
TioListener.onAfterSent(ChannelContext channelContext,
Packet packet,
boolean isSentSuccess)
消息包发送之后触发本方法
|
default void |
PacketListener.onAfterSent(ChannelContext channelContext,
Packet packet,
boolean isSentSuccess) |
default void |
GroupListener.onAfterUnbind(ChannelContext channelContext,
String group)
解绑群组后回调该方法
|
default void |
TioListener.onBeforeClose(ChannelContext channelContext,
Throwable throwable,
String remark,
boolean isRemove)
连接关闭前触发本方法
|
| 限定符和类型 | 方法和说明 |
|---|---|
ChannelContext |
ClientNodes.find(Node node) |
ChannelContext |
ClientNodes.find(String ip,
int port) |
ChannelContext |
Ids.find(TioConfig tioConfig,
String id)
Find.
|
ChannelContext |
BsIds.find(TioConfig tioConfig,
String bsId) |
| 限定符和类型 | 方法和说明 |
|---|---|
Set<ChannelContext> |
Groups.clients(TioConfig tioConfig,
String groupId)
一个组有哪些客户端
|
Set<ChannelContext> |
Users.find(TioConfig tioConfig,
String userid)
Find.
|
Set<ChannelContext> |
Tokens.find(TioConfig tioConfig,
String token)
Find.
|
Comparator<ChannelContext> |
Groups.getChannelContextComparator() |
Map<String,ChannelContext> |
Ids.getMap() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
Ids.bind(ChannelContext channelContext) |
void |
BsIds.bind(ChannelContext channelContext,
String bsId) |
void |
Users.bind(String userId,
ChannelContext channelContext)
绑定userid.
|
void |
Groups.bind(String groupId,
ChannelContext channelContext)
和组绑定
|
void |
Tokens.bind(String token,
ChannelContext channelContext)
绑定token.
|
void |
Groups.bind(String groupId,
ChannelContext channelContext,
boolean callbackListener)
和组绑定
|
static void |
MaintainUtils.close(ChannelContext channelContext) |
Set<String> |
Groups.groups(ChannelContext channelContext)
某个客户端在哪些组中
|
void |
ClientNodes.put(ChannelContext channelContext)
添加映射
|
static void |
MaintainUtils.remove(ChannelContext channelContext)
彻底删除,不再维护
|
void |
ClientNodes.remove(ChannelContext channelContext)
Removes映射
|
void |
Ids.unbind(ChannelContext channelContext) |
void |
BsIds.unbind(ChannelContext channelContext) |
void |
Users.unbind(ChannelContext channelContext)
解除channelContext绑定的userid
|
void |
Groups.unbind(ChannelContext channelContext)
与所有组解除绑定
|
void |
Tokens.unbind(ChannelContext channelContext)
解除channelContext绑定的token
|
void |
Groups.unbind(ChannelContext channelContext,
boolean callbackListener) |
void |
Groups.unbind(String groupId,
ChannelContext channelContext)
与指定组解除绑定
|
void |
Groups.unbind(String groupId,
ChannelContext channelContext,
boolean deleteFromChannelContext)
与指定组解除绑定
|
void |
Groups.unbind(String groupId,
ChannelContext channelContext,
boolean deleteFromChannelContext,
boolean callbackListener) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
Groups.setChannelContextComparator(Comparator<ChannelContext> channelContextComparator) |
| 限定符和类型 | 方法和说明 |
|---|---|
ChannelContext |
SslFacadeContext.getChannelContext() |
| 构造器和说明 |
|---|
SslFacadeContext(ChannelContext channelContext) |
SslFacadeContext(ChannelContext channelContext,
SslConfig sslConfig) |
SslHandshakeCompletedListener(ChannelContext channelContext) |
SslListener(ChannelContext channelContext) |
SslSessionClosedListener(ChannelContext channelContext) |
| 构造器和说明 |
|---|
SSLFacade(ChannelContext channelContext,
SSLContext context,
boolean client,
ClientAuth clientAuth,
ITaskHandler taskHandler) |
| 限定符和类型 | 方法和说明 |
|---|---|
Queue<ChannelContext> |
CloseRunnable.getMsgQueue() |
| 构造器和说明 |
|---|
DecodeRunnable(ChannelContext channelContext,
Executor executor) |
HandlerRunnable(ChannelContext channelContext,
Executor executor) |
SendRunnable(ChannelContext channelContext,
Executor executor) |
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
TioUtils.checkBeforeIO(ChannelContext channelContext) |
| 限定符和类型 | 类和说明 |
|---|---|
class |
ServerChannelContext |
| 限定符和类型 | 方法和说明 |
|---|---|
default boolean |
TioServerListener.onHeartbeatTimeout(ChannelContext context,
long interval,
int heartbeatTimeoutCount)
服务器检查到心跳超时时,会调用这个函数(一般场景,该方法只需要直接返回false即可)
|
| 限定符和类型 | 方法和说明 |
|---|---|
static Packet |
ProxyProtocolDecoder.decode(ByteBuffer buffer,
int readableLength,
ChannelContext context)
解码 proxy protocol
|
static void |
ProxyProtocolDecoder.enableProxyProtocol(ChannelContext context)
开始 proxy protocol
|
static boolean |
ProxyProtocolDecoder.isProxyProtocolEnabled(ChannelContext context)
判断是否开启 proxy protocol
|
static void |
ProxyProtocolDecoder.removeProxyProtocol(ChannelContext context)
去掉 proxy protocol
|
Copyright © 2023. All rights reserved.