Netty
Ziegler Han
造轮子十年,感悟:尽量不要造轮子。
展开
-
使用Netty通过Post发送Json格式数据
方式1// Prepare the HTTP request.String host = uri.getHost() == null ? "127.0.0.1" : uri.getHost();FullHttpRequest request = new DefaultFullHttpRequest( HttpVersion.HTTP_1_1, HttpMethod.POST, uri.getRawPath());request.headers().set(HttpHea.原创 2021-06-19 17:23:19 · 992 阅读 · 0 评论 -
UnPooled.copiedBuffer与wrappedBuffer的使用
Unpooled.copiedBuffer函数public final class Unpooled { /** * Creates a new big-endian buffer whose content is a copy of the * specified {@code array}. The new buffer's {@code readerIndex} and * {@code writerIndex} are {@code 0} ...原创 2020-07-05 10:59:44 · 9026 阅读 · 0 评论 -
第3章 Netty的组件和设计
第3章 Netty的组件和设计3.1 Channel、EventLoop和ChannelFuture3.1.1 Channel接口3.1.2 EventLoop接口定义了Netty的核心抽象3.1.3 ChannelFuture接口3.2 ChannelHandler和ChannelPipeline3.2.1 ChannelHandler接口3.2.2 ChannelPipeline接口为ChannelHandler链提供了容器Netty两种发送消息的方式:直接写.原创 2020-06-05 14:30:41 · 196 阅读 · 0 评论