摘要: 3.1定位 3.1.1 By.name("xxx") 定位name属性 3.1.2 By.id() 按id定位 3.1.3 By.linkText() 定位超链接 3.1.4 By.cssSelector() 速度快 3.1.5 By.xPath() 速度慢 终极方法 //F12控制台 Elemen 阅读全文
posted @ 2017-08-11 14:18 Desneo 阅读(243) 评论(0) 推荐(0) 编辑
摘要: 6.1 解码器 6.1.1 抽象类 ByteToMessageDecoder a). 必须实现的抽象方法,调用时传入包含数据的ByteBuf,一个添加解码消息的List, 对这个方法的调用会重复进行 ,直到byteBuf中没有可读取的数据。 b). 如果list不为空,那么内容会 循环 传递给下一个 阅读全文
posted @ 2017-08-09 17:42 Desneo 阅读(431) 评论(0) 推荐(0) 编辑
摘要: | 方法 | 职责 | | |: | | writeInbound(Object... msgs) | 将入站消息写入到EmbeddedChannel中 | | readInbound() | 从EmbeddedChannel中读取一个入站消息,任何返回的消息都穿过了整个ChannelPipeLin 阅读全文
posted @ 2017-08-09 17:10 Desneo 阅读(694) 评论(0) 推荐(0) 编辑
摘要: 4.1 Channelhandler 4.1.1 Channel声明周期(状态事件) | 方法 | 描述 | | : : |: | | ChannelUnregistered | Channnel已创建,但是未注册到EventLoop | | ChannelRegistered | Channnel 阅读全文
posted @ 2017-08-08 16:57 Desneo 阅读(326) 评论(0) 推荐(0) 编辑
摘要: a). 容量可按需增长,类似(StringBuilder) b). 读写模式之间不需要flip切换 c). 读和写使用不同的索引 writerIndex/readerIndex d). 支持方法的链式调用 5.1 CompositeBuffer() ByteBuf数组 5.2 生成ByteBuf d 阅读全文
posted @ 2017-08-08 12:08 Desneo 阅读(1587) 评论(0) 推荐(0) 编辑
摘要: a). EventLoopGroup为每个新创建的channel分配一个EventLoop,多个channel对应一个EventLoop. b). 一个EventLoop由一个不变的thread驱动,处理channel上所有的IO事件, c). EventLoop往上一直集成自ScheduledEx 阅读全文
posted @ 2017-08-08 11:16 Desneo 阅读(252) 评论(0) 推荐(0) 编辑
摘要: 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) 编辑
摘要: 3. 读取文件 3.1 读取class相对路径下的文件 3.2 读取jar包中配置文件 阅读全文
posted @ 2017-08-04 16:08 Desneo 阅读(209) 评论(0) 推荐(0) 编辑