LISTENER
- 监听器类型public class NioEventGroup<LISTENER extends IListener<INioSession>> extends AbstractNioEventGroup<INioCodec,LISTENER,INioSession> implements INioEventGroup<LISTENER>
Constructor and Description |
---|
NioEventGroup(IClientCfg cfg,
LISTENER listener,
INioCodec codec) |
NioEventGroup(IServerCfg cfg,
LISTENER listener,
INioCodec codec) |
Modifier and Type | Method and Description |
---|---|
protected String |
buildProcessorName() |
protected SelectableChannel |
channel() |
protected void |
channel(SelectableChannel channel) |
protected SelectableChannel |
channelCreate(IServerCfg cfg) |
protected List<NioEventProcessor<LISTENER>> |
initProcessors() |
NioEventProcessor<LISTENER> |
processor()
获取事件处理器
|
NioEventProcessor<LISTENER> |
processor(SelectionKey key)
根据通道选择键获取对象的事件处理器
|
protected List<NioEventProcessor<LISTENER>> |
processors() |
protected void |
registerEvent() |
protected int |
selectorCount() |
protected INioSession |
sessionCreate(IClientCfg cfg)
构建会话对象
|
void |
start()
启动
|
void |
stop()
停止
|
bufferSize, close, codec, connectionTimeout, executorCount, executorService, isServer, isStarted, listener, name, name, session
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
bufferSize, codec, connectionTimeout, executorCount, executorService, isServer, isStarted, listener, name, name, session
public NioEventGroup(IServerCfg cfg, LISTENER listener, INioCodec codec) throws IOException
IOException
public NioEventGroup(IClientCfg cfg, LISTENER listener, INioCodec codec) throws IOException
IOException
protected SelectableChannel channelCreate(IServerCfg cfg) throws IOException
IOException
protected INioSession sessionCreate(IClientCfg cfg) throws IOException
AbstractNioEventGroup
sessionCreate
in class AbstractNioEventGroup<INioCodec,LISTENER extends IListener<INioSession>,INioSession>
cfg
- 客户端配置IOException
- 可能产生的IO异常public void start() throws IOException
INioEventGroup
start
in interface INioEventGroup<LISTENER extends IListener<INioSession>>
start
in class AbstractNioEventGroup<INioCodec,LISTENER extends IListener<INioSession>,INioSession>
IOException
- 可能产生的IO异常protected SelectableChannel channel()
protected void channel(SelectableChannel channel)
protected int selectorCount()
protected List<NioEventProcessor<LISTENER>> processors()
protected String buildProcessorName()
protected List<NioEventProcessor<LISTENER>> initProcessors() throws IOException
IOException
protected void registerEvent() throws IOException
IOException
public void stop() throws IOException
INioEventGroup
stop
in interface INioEventGroup<LISTENER extends IListener<INioSession>>
stop
in class AbstractNioEventGroup<INioCodec,LISTENER extends IListener<INioSession>,INioSession>
IOException
- 可能产生的IO异常public NioEventProcessor<LISTENER> processor(SelectionKey key)
INioEventGroup
processor
in interface INioEventGroup<LISTENER extends IListener<INioSession>>
key
- 通道选择键public NioEventProcessor<LISTENER> processor()
INioEventGroup
processor
in interface INioEventGroup<LISTENER extends IListener<INioSession>>
Copyright © 2022. All rights reserved.