dotnetty报错xxxHandler is not @Sharable
因为在初始化Hanlder的时候没有new Handler
ServerHandler serverHandler = new ServerHandler();serverHandler.ReceivedData += ServerHandler_ReceivedData;var workerGroup = new MultithreadEventLoopGroup();bossGroup = new MultithreadEventLoopGroup(1);bootstrap = new ServerBootstrap();bootstrap.Group(bossGroup, workerGroup).Channel<TcpServerSocketChannel>().ChildHandler(new ActionChannelInitializer<ISocketChannel>(channel =>{IChannelPipeline pipeline = channel.Pipeline;pipeline.AddLast("TcpServerHandler", serverHandler);}));
解决办法在Handler中重写IsSharable,并返回true
public class ServerHandler : ChannelHandlerAdapter{/// <summary>/// 标记为Sharable/// </summary>public override bool IsSharable => true;}
正常了
dotnetty报错xxxHandler is not @Sharable相关推荐
- Netty中重连可能出现 is not a @Sharable handler 报错的处理方法
netty重连报错 场景描述 问题分析 处理方法 补充说明 参考连接: 场景描述 采用netty时进行udp的连接,代码如下,初始连接正常,当网络进行重连时就开始报错:is not a @Sharab ...
- 继承WebMvcConfigurer 和 WebMvcConfigurerAdapter类依然CORS报错? springboot 两种方式稳定解决跨域问题
继承WebMvcConfigurer 和 WebMvcConfigurerAdapter类依然CORS报错???springboot 两种方式稳定解决跨域问题! 之前我写了一篇文章,来解决CORS报错 ...
- Access to XMLHttpRequest at file from origin ‘null‘ has been blocked by CORS policy谷歌浏览器本地打开项目js文件报错
Access to XMLHttpRequest at 'file:///xxxxx/PQ.BaseInfo.proto' from origin 'null' has been blocked by ...
- go build 编译报错 missing go.sum entry for module providing package
go build 编译报错 missing go.sum entry for module providing package 解决方法 // 移除未使用的依赖 go mod tidy 再次编译,就可 ...
- docker报错:driver failed programming external connectivity on endpoint, iptables:No chain by that name
docker 报错: Error response from daemon: Cannot restart container hello: driver failed programming ext ...
- mybatis查询报错:com.mysql.cj.exceptions.DataConversionException: Cannot determine value type from string
mybatis查询报错: com.mysql.cj.exceptions.DataConversionException: Cannot determine value type from strin ...
- mongo报错:not authorized on bb to execute command { create: \“xxx\“...}
mongo报错: {"ok" : 0,"errmsg" : "not authorized on bb to execute command { cr ...
- restTemplate http请求报错:no suitable HttpMessageConverter found for response type and content type
报错信息: org.springframework.web.client.UnknownContentTypeException: Could not extract response: no sui ...
- 解决gitte提交报错 error: GE007: Your push would publish a private email address.
错误情况: gitte提交报错,无法提交上去,报错如下: remote: Powered by GITEE.COM [GNK-6.0] remote: error: GE007: Your push ...
最新文章
- Redis Sentinel 服务端实现原理
- Android动态加载技术初探
- WGAN-div:默默无闻的WGAN填坑者 | 附开源代码
- Spark Streaming从Kafka中拉取数据,并且使用过“窗口函数”统计一些流量信息
- 使用SPEncode.HtmlEncodePreserverSpace保存输入
- php矢量瓦片,矢量瓦片相关计算函数
- Python 实现单例模式的一些思考
- NP完全问题贪婪算法
- IDL实现TM遥感影像直方图统计(中值、均值、方差、众数及峰度系数计算)
- verilog实现设计3*8译码器
- 系统分析与设计复习---项目管理概述
- 安卓中关于图片的类型
- 自制原版mega2560(mega16U2 and mega2560 BootLoader 恢复再造)
- 递归算法与非递归算法的转化
- js截取数组slice() 和 splice() 的用法
- C# 数字转换成数组
- metasploit简单使用:复现永恒之蓝
- 中国各省人力资本测算就业人员受教育程度构成(2000-2021年)
- 遥感图像语义分割——从原始图像开始制作自己的数据集(以高分二号为例)
- CSS3 - footer 固定在底部(无论页面多高始终在底部)
热门文章
- php 合并重复数据合并,PHP_php合并数组中相同元素的方法,本文实例讲述了php合并数组中 - phpStudy...
- MEPG,DAT转rmvb最好的工具 Easy RealMedia Producer应用要领
- 原神来源版搭建教程 2.7版本
- in-sight 电子表格 相机设置实例
- java开发选 e3v3 i5,【选CPU必看】i5、E3、i7之间的区别以及到底怎么选?干货!
- Python打包、按任意键退出
- Python解码、编码Json的方法详解
- mac 撤销快捷键_苹果macbook pro 文本编辑撤销键
- Linux命令--hexdump(以16进制查看文件内容)
- git commit -a是干嘛的