CODEC - 编码器类型LISTENER - 监听器类型SESSION - 会话类型public abstract class AbstractNioEventGroup<CODEC extends INioCodec,LISTENER extends IListener<INioSession>,SESSION extends INioSession> extends Object implements INioEventGroup<LISTENER>
| Constructor and Description |
|---|
AbstractNioEventGroup(IClientCfg cfg,
LISTENER listener,
CODEC codec) |
AbstractNioEventGroup(IServerCfg cfg,
LISTENER listener,
CODEC codec) |
| Modifier and Type | Method and Description |
|---|---|
int |
bufferSize()
缓冲区大小
|
void |
close() |
CODEC |
codec()
编解码器
|
int |
connectionTimeout()
连接超时时间(秒)
|
int |
executorCount()
执行线程数量
|
ExecutorService |
executorService()
执行线程池
|
boolean |
isServer()
是否为服务端
|
boolean |
isStarted()
是否已启动
|
LISTENER |
listener()
监听器
|
String |
name()
客户端/服务端名称
|
void |
name(String name)
设置客户端/服务端名称
|
SESSION |
session()
会话
|
protected abstract SESSION |
sessionCreate(IClientCfg cfg)
构建会话对象
|
void |
start()
启动
|
void |
stop()
停止
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitprocessor, processorpublic AbstractNioEventGroup(IServerCfg cfg, LISTENER listener, CODEC codec)
public AbstractNioEventGroup(IClientCfg cfg, LISTENER listener, CODEC codec) throws IOException
IOExceptionpublic void start()
throws IOException
INioEventGroupstart in interface INioEventGroup<LISTENER extends IListener<INioSession>>IOException - 可能产生的IO异常public void stop()
throws IOException
INioEventGroupstop in interface INioEventGroup<LISTENER extends IListener<INioSession>>IOException - 可能产生的IO异常public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionprotected abstract SESSION sessionCreate(IClientCfg cfg) throws IOException
cfg - 客户端配置IOException - 可能产生的IO异常public CODEC codec()
INioEventGroupcodec in interface INioEventGroup<LISTENER extends IListener<INioSession>>public LISTENER listener()
INioEventGrouplistener in interface INioEventGroup<LISTENER extends IListener<INioSession>>public SESSION session()
INioEventGroupsession in interface INioEventGroup<LISTENER extends IListener<INioSession>>public boolean isServer()
INioEventGroupisServer in interface INioEventGroup<LISTENER extends IListener<INioSession>>public boolean isStarted()
INioEventGroupisStarted in interface INioEventGroup<LISTENER extends IListener<INioSession>>public String name()
INioEventGroupname in interface INioEventGroup<LISTENER extends IListener<INioSession>>public void name(String name)
INioEventGroupname in interface INioEventGroup<LISTENER extends IListener<INioSession>>name - 名称public int bufferSize()
INioEventGroupbufferSize in interface INioEventGroup<LISTENER extends IListener<INioSession>>public int executorCount()
INioEventGroupexecutorCount in interface INioEventGroup<LISTENER extends IListener<INioSession>>public int connectionTimeout()
INioEventGroupconnectionTimeout in interface INioEventGroup<LISTENER extends IListener<INioSession>>public ExecutorService executorService()
INioEventGroupexecutorService in interface INioEventGroup<LISTENER extends IListener<INioSession>>Copyright © 2022. All rights reserved.