
netty
酒醉梦醒
JAVA
展开
-
netty源码之channel初始化
文章目录netty源码之channel初始化入口说明channel初始化 netty源码之channel初始化 入口说明 ChannelFuture future = server.bind(port).sync(); AbstractBootstrap#bind(int inetPort) AbstractBootstrap#bind(SocketAddress localAddress) AbstractBootstrap#doBind(final SocketAddress localAdd原创 2020-07-29 15:34:44 · 549 阅读 · 0 评论 -
netty源码之EventLoopGroup
文章目录netty源码之EventLoopGroup前言类图及接口说明源码分析默认选择策略工厂事件执行器选择工厂newChildopenSelector总结 netty源码之EventLoopGroup 前言 本文基于windows下的netty4.1.41.Final版本,以后也都是基于此版本, 注意,不太相关的代码笔者会直接省略 本文主要分析以下两行代码 EventLoopGroup bossGroup = new NioEventLoopGroup(1); EventLoopGroup wo原创 2020-07-08 17:56:57 · 478 阅读 · 0 评论 -
spring零配置+websocket聊天室
spring零配置+websocket聊天室 效果图 私聊 xxx用户 lry用户 群聊 lry用户 xxx用户 ll用户 聊天面板 git pet https://github.com/lrydl/pet.git原创 2019-10-29 12:08:06 · 380 阅读 · 1 评论 -
netty+protobuf实现聊天室
netty+protobuf实现聊天室 实现的功能 登陆,注册,私聊,群聊 代码 proto文件msg.proto syntax = "proto2"; message Request{ //消息类型 ,用户名,密码,消息,接收者(私聊,群聊) required int32 type = 1;//登录,心跳,私聊,群聊 required string username = ...原创 2019-10-29 11:16:22 · 862 阅读 · 0 评论 -
基于netty的RPC框架
基于netty的RPC框架 什么是rpc rpc是远程过程调用的简称,它可以通过网络调用另一台服务器的某个方法 技术点 网络编程,反射,协议 代码 pom <dependency> <groupId>com.google.protobuf</groupId> <artifactId>protobuf-java</arti...原创 2019-10-29 11:03:17 · 706 阅读 · 0 评论 -
netty学习(入门篇)
文章目录netty学习(入门篇)netty诞生简介netty服务器netty客户端 netty学习(入门篇) netty诞生简介 2002年之前,那时候java还没有nio的概念,没有channel,没有缓冲区,io模式是同步阻塞的,想要编写高性能的服务器几乎是不可能的,那时候基本上服务器都是由c,c++编写的,直到jdk1.4java第一次支持了nio,这个类库为java通信模式带来了翻天覆地的...原创 2019-09-18 16:31:40 · 510 阅读 · 0 评论 -
netty粘包
文章目录netty粘包粘包是什么解决方案FixedLengthFrameDecoderLineBasedFrameDecoderDelimiterBasedFrameDecoderLengthFieldBasedFrameDecoder netty粘包 粘包是什么 ctx.writeAndFlush("hello world"); ctx.writeAndFlush("hell...原创 2019-09-18 17:38:11 · 378 阅读 · 0 评论