Modifier and Type | Class and Description |
---|---|
class |
ClientTioConfig |
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_GROUPCONTEXTS
本jvm中所有的TioConfig对象
|
Modifier and Type | Method and Description |
---|---|
TioConfig |
ChannelContext.getTioConfig() |
Modifier and Type | Method and Description |
---|---|
static boolean |
Tio.IpBlacklist.add(TioConfig tioConfig,
String ip)
把ip添加到黑名单,此黑名单只针对tioConfig有效,其它tioConfig不会把这个ip视为黑名单
|
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.bSendToIp(TioConfig tioConfig,
String ip,
Packet packet)
阻塞发送到指定ip对应的集合
|
static Boolean |
Tio.bSendToIp(TioConfig tioConfig,
String ip,
Packet packet,
ChannelContextFilter channelContextFilter)
阻塞发送到指定ip对应的集合
|
static Boolean |
Tio.bSendToSet(TioConfig tioConfig,
SetWithLock<ChannelContext> setWithLock,
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.IpBlacklist.clear(TioConfig tioConfig)
清空黑名单,只针对tioConfig有效
|
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.closeIp(TioConfig tioConfig,
String ip,
String remark)
关闭某群所有连接
|
static void |
Tio.closeIp(TioConfig tioConfig,
String ip,
String remark,
ChannelContext.CloseCode closeCode)
关闭某群所有连接
|
static void |
Tio.closeSet(TioConfig tioConfig,
SetWithLock<ChannelContext> setWithLock,
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 SetWithLock<ChannelContext> |
Tio.getAll(TioConfig tioConfig)
获取所有连接,包括当前处于断开状态的
|
static Collection<String> |
Tio.IpBlacklist.getAll(TioConfig tioConfig)
获取ip黑名单列表
|
static SetWithLock<ChannelContext> |
Tio.getAllChannelContexts(TioConfig tioConfig)
Deprecated.
用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,
String clientIp,
Integer clientPort)
根据clientip和clientport获取ChannelContext
|
static SetWithLock<ChannelContext> |
Tio.getByGroup(TioConfig tioConfig,
String group)
获取一个组的所有客户端
|
static SetWithLock<ChannelContext> |
Tio.getByIp(TioConfig tioConfig,
String ip)
根据客户端ip获取SetWithLock
|
static SetWithLock<ChannelContext> |
Tio.getByToken(TioConfig tioConfig,
String token)
根据token获取SetWithLock
|
static SetWithLock<ChannelContext> |
Tio.getByUserid(TioConfig tioConfig,
String userid)
根据userid获取SetWithLock
|
static ChannelContext |
Tio.getChannelContextByBsId(TioConfig tioConfig,
String bsId)
Deprecated.
用getByBsId(TioConfig tioConfig, String bsId)
|
static ChannelContext |
Tio.getChannelContextByClientNode(TioConfig tioConfig,
String clientIp,
Integer clientPort)
Deprecated.
getByClientNode(tioConfig, clientIp, clientPort)
|
static ChannelContext |
Tio.getChannelContextById(TioConfig tioConfig,
String channelContextId)
Deprecated.
用getByChannelContextId(tioConfig, channelContextId)
|
static SetWithLock<ChannelContext> |
Tio.getChannelContextsByGroup(TioConfig tioConfig,
String group)
Deprecated.
用getByGroup(tioConfig, group)
|
static SetWithLock<ChannelContext> |
Tio.getChannelContextsByToken(TioConfig tioConfig,
String token)
Deprecated.
用getByToken(tioConfig, token)
|
static SetWithLock<ChannelContext> |
Tio.getChannelContextsByUserid(TioConfig tioConfig,
String userid)
Deprecated.
用getByUserid(tioConfig, userid)
|
static Page<ChannelContext> |
Tio.getPageOfAll(TioConfig tioConfig,
Integer pageIndex,
Integer pageSize) |
static <T> Page<T> |
Tio.getPageOfAll(TioConfig tioConfig,
Integer pageIndex,
Integer pageSize,
Converter<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,
Converter<T> converter) |
static int |
Tio.groupCount(TioConfig tioConfig,
String group)
群组有多少个连接
|
void |
ChannelContext.init(TioConfig tioConfig,
AsynchronousSocketChannel asynchronousSocketChannel) |
static boolean |
Tio.IpBlacklist.isInBlacklist(TioConfig tioConfig,
String ip)
是否在黑名单中
|
static void |
Tio.IpBlacklist.remove(TioConfig tioConfig,
String ip)
把ip从黑名单中删除
|
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.removeIp(TioConfig tioConfig,
String ip,
String remark)
关闭某群所有连接
|
static void |
Tio.removeIp(TioConfig tioConfig,
String ip,
String remark,
ChannelContext.CloseCode removeCode)
关闭某群所有连接
|
static void |
Tio.removeSet(TioConfig tioConfig,
SetWithLock<ChannelContext> setWithLock,
String remark,
ChannelContext.CloseCode closeCode)
移除集合
|
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.sendToIp(TioConfig tioConfig,
String ip,
Packet packet)
发送到指定ip对应的集合
|
static void |
Tio.sendToIp(TioConfig tioConfig,
String ip,
Packet packet,
ChannelContextFilter channelContextFilter)
发送到指定ip对应的集合
|
static void |
Tio.sendToSet(TioConfig tioConfig,
SetWithLock<ChannelContext> setWithLock,
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)
发消息给指定用户
|
void |
ChannelContext.setTioConfig(TioConfig tioConfig) |
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(TioConfig tioConfig,
String id)
创建一个虚拟ChannelContext,主要用来模拟一些操作,譬如压力测试,真实场景中用得少
|
Constructor and Description |
---|
IpStatRemovalListener(TioConfig tioConfig,
IpStatListener ipStatListener) |
Modifier and Type | Method and Description |
---|---|
ByteBuffer |
AioHandler.encode(Packet packet,
TioConfig tioConfig,
ChannelContext channelContext)
编码
|
Modifier and Type | Method and Description |
---|---|
SetWithLock<ChannelContext> |
Groups.clients(TioConfig tioConfig,
String groupid)
一个组有哪些客户端
|
SetWithLock<ChannelContext> |
Ips.clients(TioConfig tioConfig,
String ip)
一个ip有哪些客户端,有可能返回null
|
ChannelContext |
BsIds.find(TioConfig tioConfig,
String bsId) |
SetWithLock<ChannelContext> |
Users.find(TioConfig tioConfig,
String userid)
Find.
|
SetWithLock<ChannelContext> |
Tokens.find(TioConfig tioConfig,
String token)
Find.
|
ChannelContext |
Ids.find(TioConfig tioConfig,
String id)
Find.
|
void |
Users.unbind(TioConfig tioConfig,
String userid)
解除tioConfig范围内所有ChannelContext的 userid绑定
|
void |
Tokens.unbind(TioConfig tioConfig,
String token)
解除tioConfig范围内所有ChannelContext的 token绑定
|
Constructor and Description |
---|
IpStats(TioConfig tioConfig,
Long[] durations) |
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 | Method and Description |
---|---|
void |
IpStatListener.onExpired(TioConfig tioConfig,
IpStat ipStat)
统计时间段到期后,用户可以在这个方法中实现把相关数据入库或是打日志等
|
void |
DefaultIpStatListener.onExpired(TioConfig tioConfig,
IpStat ipStat) |
Modifier and Type | Method and Description |
---|---|
ByteBuffer |
FlashPolicyServerAioHandler.encode(Packet packet,
TioConfig tioConfig,
ChannelContext channelContext) |
Modifier and Type | Method and Description |
---|---|
static ByteBuffer |
HttpResponseEncoder.encode(HttpResponse httpResponse,
TioConfig tioConfig,
ChannelContext channelContext) |
Modifier and Type | Method and Description |
---|---|
ByteBuffer |
HttpServerAioHandler.encode(Packet packet,
TioConfig tioConfig,
ChannelContext channelContext) |
Modifier and Type | Method and Description |
---|---|
void |
IpPathAccessStatListener.onExpired(TioConfig tioConfig,
String ip,
IpAccessStat ipAccessStat) |
Constructor and Description |
---|
IpPathAccessStatRemovalListener(TioConfig tioConfig,
IpPathAccessStatListener ipPathAccessStatListener) |
IpPathAccessStats(StatPathFilter statPathFilter,
TioConfig tioConfig,
IpPathAccessStatListener ipPathAccessStatListener,
Long[] durations) |
Modifier and Type | Method and Description |
---|---|
void |
TokenPathAccessStatListener.onExpired(TioConfig tioConfig,
String token,
TokenAccessStat tokenAccessStat) |
Constructor and Description |
---|
TokenPathAccessStatRemovalListener(TioConfig tioConfig,
TokenPathAccessStatListener tokenPathAccessStatListener) |
TokenPathAccessStats(StatPathFilter statPathFilter,
CurrUseridGetter currUseridGetter,
TioConfig tioConfig,
TokenPathAccessStatListener tokenPathAccessStatListener,
Long[] durations) |
TokenPathAccessStats(StatPathFilter statPathFilter,
TokenGetter tokenGetter,
CurrUseridGetter currUseridGetter,
TioConfig tioConfig,
TokenPathAccessStatListener tokenPathAccessStatListener,
Long[] durations) |
Modifier and Type | Class and Description |
---|---|
class |
ServerTioConfig |
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 |
WsClientAioHander.encode(Packet packet,
TioConfig tioConfig,
ChannelContext ctx) |
Modifier and Type | Method and Description |
---|---|
static ByteBuffer |
HttpRequestEncoder.encode(HttpRequest httpRequest,
TioConfig tioConfig,
ChannelContext channelContext) |
Modifier and Type | Method and Description |
---|---|
static ByteBuffer |
WsClientEncoder.encode(WsPacket packet,
TioConfig tioConfig,
ChannelContext channelContext) |
static ByteBuffer |
WsServerEncoder.encode(WsResponse wsResponse,
TioConfig tioConfig,
ChannelContext channelContext) |
Modifier and Type | Method and Description |
---|---|
ByteBuffer |
WsServerAioHandler.encode(Packet packet,
TioConfig tioConfig,
ChannelContext channelContext) |
Copyright © 2021. All rights reserved.