| Package | Description |
|---|---|
| org.tio.client | |
| org.tio.core | |
| org.tio.core.intf | |
| org.tio.core.maintain | |
| org.tio.core.ssl | |
| org.tio.server | |
| org.tio.server.cluster.core |
| Modifier and Type | Class and Description |
|---|---|
class |
TioClientConfig |
| Constructor and Description |
|---|
ClientChannelContext(TioConfig tioConfig)
创建一个虚拟ChannelContext,主要用来模拟一些操作,真实场景中用得少
|
ClientChannelContext(TioConfig tioConfig,
AsynchronousSocketChannel asynchronousSocketChannel) |
| Modifier and Type | Field and Description |
|---|---|
TioConfig |
ChannelContext.tioConfig |
| Modifier and Type | Field and Description |
|---|---|
static Set<TioConfig> |
TioConfig.ALL_GROUP_CONTEXTS
本jvm中所有的TioConfig对象
|
| Modifier and Type | Method and Description |
|---|---|
TioConfig |
ChannelContext.getTioConfig() |
| Modifier and Type | Method and Description |
|---|---|
static void |
Tio.bindGroup(TioConfig tioConfig,
String userid,
String group)
将用户绑定到群组
|
static boolean |
Tio.bSend(TioConfig tioConfig,
String ip,
int port,
Packet packet)
发送到指定的ip和port
|
static boolean |
Tio.bSendToAll(TioConfig tioConfig,
Packet packet,
ChannelContextFilter channelContextFilter)
发消息到所有连接
|
static boolean |
Tio.bSendToBsId(TioConfig tioConfig,
String bsId,
Packet packet)
阻塞发消息给指定业务ID
|
static boolean |
Tio.bSendToGroup(TioConfig tioConfig,
String group,
Packet packet)
发消息到组
|
static boolean |
Tio.bSendToGroup(TioConfig tioConfig,
String group,
Packet packet,
ChannelContextFilter channelContextFilter)
发消息到组
|
static boolean |
Tio.bSendToId(TioConfig tioConfig,
String channelContextId,
Packet packet)
发消息给指定ChannelContext id
|
static boolean |
Tio.bSendToSet(TioConfig tioConfig,
Set<ChannelContext> set,
Packet packet,
ChannelContextFilter channelContextFilter)
发消息到指定集合
|
static boolean |
Tio.bSendToToken(TioConfig tioConfig,
String token,
Packet packet)
阻塞发消息到指定token
|
static boolean |
Tio.bSendToUser(TioConfig tioConfig,
String userid,
Packet packet)
阻塞发消息给指定用户
|
static void |
Tio.close(TioConfig tioConfig,
String clientIp,
Integer clientPort,
Throwable throwable,
String remark)
关闭连接
|
static void |
Tio.closeGroup(TioConfig tioConfig,
String group,
String remark)
关闭某群所有连接
|
static void |
Tio.closeGroup(TioConfig tioConfig,
String group,
String remark,
ChannelContext.CloseCode closeCode)
关闭某群所有连接
|
static void |
Tio.closeToken(TioConfig tioConfig,
String token,
String remark)
关闭token的所有连接
|
static void |
Tio.closeToken(TioConfig tioConfig,
String token,
String remark,
ChannelContext.CloseCode closeCode)
关闭某token的所有连接
|
static void |
Tio.closeUser(TioConfig tioConfig,
String userid,
String remark)
关闭用户的所有连接
|
static void |
Tio.closeUser(TioConfig tioConfig,
String userid,
String remark,
ChannelContext.CloseCode closeCode)
关闭某用户的所有连接
|
static Set<ChannelContext> |
Tio.getAll(TioConfig tioConfig)
获取所有连接,包括当前处于断开状态的
|
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.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 Page<ChannelContext> |
Tio.getPageOfAll(TioConfig tioConfig,
Integer pageIndex,
Integer pageSize)
服务端,获取所有的连接
|
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 Page<ChannelContext> |
Tio.getPageOfGroup(TioConfig tioConfig,
String group,
Integer pageIndex,
Integer pageSize) |
static <T> Page<T> |
Tio.getPageOfGroup(TioConfig tioConfig,
String group,
Integer pageIndex,
Integer pageSize,
Function<ChannelContext,T> converter) |
static int |
Tio.groupCount(TioConfig tioConfig,
String group)
群组有多少个连接
|
void |
ChannelContext.init(TioConfig tioConfig,
AsynchronousSocketChannel asynchronousSocketChannel) |
static void |
Tio.remove(TioConfig tioConfig,
String clientIp,
Integer clientPort,
Throwable throwable,
String remark)
和close方法对应,只不过不再进行重连等维护性的操作
|
static void |
Tio.remove(TioConfig tioConfig,
String clientIp,
Integer clientPort,
Throwable throwable,
String remark,
ChannelContext.CloseCode closeCode)
删除clientip和clientPort为指定值的连接
|
static void |
Tio.removeGroup(TioConfig tioConfig,
String group,
String remark)
关闭某群所有连接
|
static void |
Tio.removeGroup(TioConfig tioConfig,
String group,
String remark,
ChannelContext.CloseCode removeCode)
关闭某群所有连接
|
static void |
Tio.removeToken(TioConfig tioConfig,
String token,
String remark)
关闭token的所有连接
|
static void |
Tio.removeToken(TioConfig tioConfig,
String token,
String remark,
ChannelContext.CloseCode removeCode)
关闭某token的所有连接
|
static void |
Tio.removeUser(TioConfig tioConfig,
String userid,
String remark)
关闭用户的所有连接
|
static void |
Tio.removeUser(TioConfig tioConfig,
String userid,
String remark,
ChannelContext.CloseCode removeCode)
关闭某用户的所有连接
|
static boolean |
Tio.send(TioConfig tioConfig,
String ip,
int port,
Packet packet)
发送到指定的ip和port
|
static void |
Tio.sendToAll(TioConfig tioConfig,
Packet packet)
发消息到所有连接
|
static void |
Tio.sendToAll(TioConfig tioConfig,
Packet packet,
ChannelContextFilter channelContextFilter)
发消息到所有连接
|
static boolean |
Tio.sendToBsId(TioConfig tioConfig,
String bsId,
Packet packet)
发消息给指定业务ID
|
static void |
Tio.sendToGroup(TioConfig tioConfig,
String group,
Packet packet)
发消息到组
|
static void |
Tio.sendToGroup(TioConfig tioConfig,
String group,
Packet packet,
ChannelContextFilter channelContextFilter)
发消息到组
|
static boolean |
Tio.sendToId(TioConfig tioConfig,
String channelContextId,
Packet packet)
发消息给指定ChannelContext id
|
static void |
Tio.sendToSet(TioConfig tioConfig,
Set<ChannelContext> set,
Packet packet,
ChannelContextFilter channelContextFilter)
发消息到指定集合
|
static boolean |
Tio.sendToToken(TioConfig tioConfig,
String token,
Packet packet)
发消息到指定token
|
static boolean |
Tio.sendToUser(TioConfig tioConfig,
String userid,
Packet packet)
发消息给指定用户
|
static void |
Tio.unbindGroup(TioConfig tioConfig,
String userid,
String group)
将某用户从组中解除绑定
|
static void |
Tio.unbindToken(TioConfig tioConfig,
String token)
解除token
|
static void |
Tio.unbindUser(TioConfig tioConfig,
String userid)
解除userid的绑定。
|
| Constructor and Description |
|---|
ChannelContext(TioConfig tioConfig)
创建一个虚拟ChannelContext,主要用来模拟一些操作,譬如压力测试,真实场景中用得少
|
ChannelContext(TioConfig tioConfig,
AsynchronousSocketChannel asynchronousSocketChannel)
ChannelContext
|
ChannelContext(TioConfig tioConfig,
String id)
创建一个虚拟ChannelContext,主要用来模拟一些操作,譬如压力测试,真实场景中用得少
|
| Modifier and Type | Method and Description |
|---|---|
ByteBuffer |
TioHandler.encode(Packet packet,
TioConfig tioConfig,
ChannelContext context)
编码
|
| Modifier and Type | Method and Description |
|---|---|
Set<ChannelContext> |
Groups.clients(TioConfig tioConfig,
String groupId)
一个组有哪些客户端
|
ChannelContext |
Ids.find(TioConfig tioConfig,
String id)
Find.
|
ChannelContext |
BsIds.find(TioConfig tioConfig,
String bsId) |
Set<ChannelContext> |
Users.find(TioConfig tioConfig,
String userid)
Find.
|
Set<ChannelContext> |
Tokens.find(TioConfig tioConfig,
String token)
Find.
|
void |
Users.unbind(TioConfig tioConfig,
String userId)
解除tioConfig范围内所有ChannelContext的 userid绑定
|
void |
Tokens.unbind(TioConfig tioConfig,
String token)
解除tioConfig范围内所有ChannelContext的 token绑定
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
SslUtils.isSsl(TioConfig tioConfig)
是否是SSL连接
|
static boolean |
SslUtils.needSslEncrypt(Packet packet,
TioConfig tioConfig)
是否需要对这个packet进行SSL加密
|
| Modifier and Type | Class and Description |
|---|---|
class |
TioServerConfig |
| Constructor and Description |
|---|
ServerChannelContext(TioConfig tioConfig)
创建一个虚拟ChannelContext,主要用来模拟一些操作,真实场景中用得少
|
ServerChannelContext(TioConfig tioConfig,
AsynchronousSocketChannel asynchronousSocketChannel) |
ServerChannelContext(TioConfig tioConfig,
String id)
创建一个虚拟ChannelContext,主要用来模拟一些操作,譬如压力测试,真实场景中用得少
|
| Modifier and Type | Method and Description |
|---|---|
ByteBuffer |
ClusterTcpServerHandler.encode(Packet packet,
TioConfig tioConfig,
ChannelContext context) |
ByteBuffer |
ClusterTcpClientHandler.encode(Packet packet,
TioConfig tioConfig,
ChannelContext context) |
Copyright © 2025. All rights reserved.