public abstract class GroupContext extends MapWithLockPropSupport
Modifier and Type | Field and Description |
---|---|
BsIds |
bsIds |
ClientNodes |
clientNodes |
CloseRunnable |
closeRunnable |
SetWithLock<ChannelContext> |
connections |
boolean |
debug |
ThreadPoolExecutor |
groupExecutor |
Groups |
groups |
GroupStat |
groupStat |
long |
heartbeatTimeout
心跳超时时间(单位: 毫秒),如果用户不希望框架层面做心跳相关工作,请把此值设为0或负数
|
protected String |
id
packet编码成bytebuffer时,是否与ChannelContext相关,false: packet编码与ChannelContext无关
|
Ids |
ids |
IpBlacklist |
ipBlacklist
ip黑名单
|
Ips |
ips |
IpStats |
ipStats |
boolean |
isShortConnection |
protected int |
maxDecodeErrorCountForIp
解码异常多少次就把ip拉黑
|
protected String |
name |
PacketConverter |
packetConverter |
PacketHandlerMode |
packetHandlerMode |
static int |
READ_BUFFER_SIZE
默认的接收数据的buffer size
|
SslConfig |
sslConfig |
long |
startTime
启动时间
|
boolean |
statOn |
SynThreadPoolExecutor |
tioExecutor |
Tokens |
tokens |
boolean |
useQueueDecode
是否用队列解码(系统初始化时确定该值,中途不要变更此值,否则在切换的时候可能导致消息丢失)
|
boolean |
useQueueSend
是否用队列发送
|
Users |
users |
MapWithLock<Integer,Packet> |
waitingResps |
Constructor and Description |
---|
GroupContext() |
GroupContext(SynThreadPoolExecutor tioExecutor,
ThreadPoolExecutor groupExecutor) |
clearAttribute, getAttribute, removeAttribute, setAttribute
public static final int READ_BUFFER_SIZE
public boolean isShortConnection
public SslConfig sslConfig
public boolean debug
public GroupStat groupStat
public boolean statOn
public PacketConverter packetConverter
public long startTime
public boolean useQueueSend
public boolean useQueueDecode
public long heartbeatTimeout
public PacketHandlerMode packetHandlerMode
public SynThreadPoolExecutor tioExecutor
public CloseRunnable closeRunnable
public ThreadPoolExecutor groupExecutor
public ClientNodes clientNodes
public SetWithLock<ChannelContext> connections
public Groups groups
public Users users
public Tokens tokens
public Ids ids
public BsIds bsIds
public Ips ips
public IpStats ipStats
public IpBlacklist ipBlacklist
public MapWithLock<Integer,Packet> waitingResps
protected String id
protected int maxDecodeErrorCountForIp
protected String name
public GroupContext()
public GroupContext(SynThreadPoolExecutor tioExecutor, ThreadPoolExecutor groupExecutor)
tioExecutor
- groupExecutor
- public void share(GroupContext groupContext)
public abstract AioHandler getAioHandler()
public abstract AioListener getAioListener()
public boolean isCluster()
public ByteOrder getByteOrder()
public GroupListener getGroupListener()
public String getId()
public String getName()
public TioUuid getTioUuid()
public MapWithLock<Integer,Packet> getWaitingResps()
public boolean isStopped()
public void setByteOrder(ByteOrder byteOrder)
byteOrder
- public void setGroupListener(GroupListener groupListener)
groupListener
- the groupListener to setpublic void setHeartbeatTimeout(long heartbeatTimeout)
heartbeatTimeout
- the heartbeatTimeout to setpublic void setName(String name)
public void setPacketHandlerMode(PacketHandlerMode packetHandlerMode)
packetHandlerMode
- the packetHandlerMode to setpublic void setReadBufferSize(int readBufferSize)
readBufferSize
- the readBufferSize to setpublic void setShortConnection(boolean isShortConnection)
isShortConnection
- the isShortConnection to setpublic void setStopped(boolean isStopped)
isStop
- the isStop to setpublic void setTioUuid(TioUuid tioUuid)
tioUuid
- the tioUuid to setpublic TioClusterConfig getTioClusterConfig()
public void setTioClusterConfig(TioClusterConfig tioClusterConfig)
public void setSslConfig(SslConfig sslConfig)
public IpStatListener getIpStatListener()
public void setIpStatListener(IpStatListener ipStatListener)
public GroupStat getGroupStat()
public void setUseQueueDecode(boolean useQueueDecode)
useQueueDecode
- public void setUseQueueSend(boolean useQueueSend)
useQueueSend
- public abstract boolean isServer()
public int getReadBufferSize()
public boolean isSsl()
Copyright © 2018. All rights reserved.