`
liuzhaodong89
  • 浏览: 59820 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

Mina学习随笔一

阅读更多

翻mina的源代码的时候,在NioProcessor里面居然看到这么个方法:

 

    @Override
    protected int read(NioSession session, IoBuffer buf) throws Exception {
        ByteChannel channel = session.getChannel();
        
        return session.getChannel().read(buf.buf());
    }

 也不知道这哥们咋想的,设置一个channel的引用,然后让它在那里闲的没事干。和应用里if(){}else{......}这样的代码一样看起来可乐

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics