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, sessionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbufferSize, codec, connectionTimeout, executorCount, executorService, isServer, isStarted, listener, name, name, sessionpublic NioEventGroup(IServerCfg cfg, LISTENER listener, INioCodec codec) throws IOException
IOExceptionpublic NioEventGroup(IClientCfg cfg, LISTENER listener, INioCodec codec) throws IOException
IOExceptionprotected SelectableChannel channelCreate(IServerCfg cfg) throws IOException
IOExceptionprotected INioSession sessionCreate(IClientCfg cfg) throws IOException
AbstractNioEventGroupsessionCreate in class AbstractNioEventGroup<INioCodec,LISTENER extends IListener<INioSession>,INioSession>cfg - 客户端配置IOException - 可能产生的IO异常public void start()
throws IOException
INioEventGroupstart 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
IOExceptionprotected void registerEvent()
throws IOException
IOExceptionpublic void stop()
throws IOException
INioEventGroupstop 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)
INioEventGroupprocessor in interface INioEventGroup<LISTENER extends IListener<INioSession>>key - 通道选择键public NioEventProcessor<LISTENER> processor()
INioEventGroupprocessor in interface INioEventGroup<LISTENER extends IListener<INioSession>>Copyright © 2022. All rights reserved.