LISTENER - 监听器类型public class NioEventProcessor<LISTENER extends IListener<INioSession>> extends AbstractNioEventProcessor<LISTENER>
Thread.State, Thread.UncaughtExceptionHandlerMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
NioEventProcessor(INioEventGroup<LISTENER> eventGroup,
String name) |
| Modifier and Type | Method and Description |
|---|---|
protected INioSession |
buildNioSession(INioEventGroup<LISTENER> eventGroup,
SelectableChannel channel)
由子类实现创建会话的具体逻辑
|
protected void |
onReadEvent(SelectionKey key)
由子类实现通道读逻辑
|
protected void |
onWriteEvent(SelectionKey key)
由子类实现通道写逻辑
|
close, interrupt, onExceptionEvent, registerEvent, run, selector, start, unregisterEventactiveCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, toString, yieldpublic NioEventProcessor(INioEventGroup<LISTENER> eventGroup, String name) throws IOException
IOExceptionprotected INioSession buildNioSession(INioEventGroup<LISTENER> eventGroup, SelectableChannel channel)
AbstractNioEventProcessorbuildNioSession in class AbstractNioEventProcessor<LISTENER extends IListener<INioSession>>eventGroup - 多路复用通道事件处理器channel - 通道protected void onReadEvent(SelectionKey key) throws IOException
AbstractNioEventProcessoronReadEvent in class AbstractNioEventProcessor<LISTENER extends IListener<INioSession>>key - 选择键IOException - 可能产生的I/O异常protected void onWriteEvent(SelectionKey key) throws IOException
AbstractNioEventProcessoronWriteEvent in class AbstractNioEventProcessor<LISTENER extends IListener<INioSession>>key - 选择键IOException - 可能产生的I/O异常Copyright © 2022. All rights reserved.