????3??IoSession

????IoSession??????????IoService????????????IoService?????????????????IoSession????????????session????IoSession???????????Connection?????????????

????????????

????1???????????session.getSessionConfig.XX???????????????????????????????????ν??????????acceptor??connector?????acceptor??connector????????????????session?????????????????????а??????????????????????????????????????????????в????????????????????С????????????

????2???洢?????session.setAttribute()??????web???session??????????session??д洢attribute??????????????????????洢???????????й???????????????web??????????Щ???????????

????3????????д????????session.write()??

????4?????????Session????????????е?byte??message????????

????4??IoHandler

public interface IoHandler {
    void sessionCreated(IoSession session) throws Exception;
    void sessionOpened(IoSession session) throws Exception;
    void sessionClosed(IoSession session) throws Exception;
    void sessionIdle(IoSession session?? IdleStatus status) throws Exception;
    void exceptionCaught(IoSession session?? Throwable cause) throws Exception;
    void messageReceived(IoSession session?? Object message) throws Exception;
    void messageSent(IoSession session?? Object message) throws Exception;
}

???????????£????????????messageReceived??????????????????????????IoSession??write?????????????????????o??????????IoHandler??????????????????????IoHandlerAdapter?????????????????7????????????????????????????е?????????????

????5??IoFilter

????Mina?????????????????????????Java??????????ó??????????ó????????????????????????????Щ??????IoFilter?????

????Filter???????????????IoFilter??I/O?????????????IoFilter??Servlet?е?????????????????????????????紫????I/O??????????????

????IoService?????????DefaultIoFilterChainBuilder ---- ???????????????????????????????IoFilter???????????????????????????

????Mina??????????????

????CumulativeProtocolDecoder ??????????

????SynchronizedProtocolDecoder ???????????????κ???????????????????????????????????????????decode()???????????????????ε????????????????????????????????????????

????TextLineDecoder ???????????з??? Windows: ??Linux: ??Mac: ???????????

????????????????

????1??????????????????д???doDecode/doEncode????

????2????дProtocolCodecFactory??????