摘要: 2.1 ChannelOption和属性 //设置属性 bootstrap.option("xxx", 1231231); bootstrap.attr("xxx", 123123); //获取属性值 int idValue = ctx.channel.attr("xxx").get(); 阅读全文
posted @ 2017-08-07 19:45 Desneo 阅读(358) 评论(0) 推荐(0) 编辑
摘要: 0. 关键点 1.1 Channel 类似socket,管道 1.2 回调 操作完成时调用 1.3 Future 异步通知 更精确的异步 类似更精确的异步。 JDK预置concurrent.Future需要手动检查对应的操作是否已完成,非常繁琐。 Netty封装成ChannelFuture消除手动检 阅读全文
posted @ 2017-08-07 16:29 Desneo 阅读(339) 评论(0) 推荐(0) 编辑
摘要: 1. Server端 socket/bind/listen/accept/read 2. Client端 socket/connect/write 3. IO复用 3.1 Select指定事件发生时唤醒 int select (int maxfdp1, fd_set readset, fd_set 阅读全文
posted @ 2017-08-07 10:45 Desneo 阅读(171) 评论(0) 推荐(0) 编辑