Comments (8)
0.7.3版本中增加了maxFramePayloadLength属性,进行配置即可.
预计0点后可在maven**仓库下载
或者直接clone源码install到本地仓库
from netty-websocket-spring-boot-starter.
没有现成的配置可以直接设置这个值
因为考虑到部分场景,连接数与真实的资源消耗并不是绝对的正比,直接限制连接数并不能带来最好的效果,而设置backlog(与Netty中的backlog一致)将是一个更好的选择.
如果需要限制session的最大大小,可以很简单的实现
如:在@serverendpoint的类里面加入AtomicInteger类型的全局变量来进行限制.(连接成功时+1,关闭时-1.当数量超过限制时强制关闭)
from netty-websocket-spring-boot-starter.
我是指如果我把文件流在@onbinary中传递时太大的文件流会直接断掉,不是指限制连接数,可能我之前的表述有问题把
from netty-websocket-spring-boot-starter.
如果是server有限制,会报错,可以看下报错信息.
或者是否client对每次消息大小有限制
另外,具体文件大小是多少
from netty-websocket-spring-boot-starter.
这是server端的报错信息:io.netty.handler.codec.CorruptedFrameException: Max frame length of 65536 has been exceeded
client端时有分片分批传输的,调小了区间是可以正常使用的,只是我想把大小设的稍微大一点,这样分块分的太多了,所以想知道是否有可以直接调整的配置项和方法可用
from netty-websocket-spring-boot-starter.
这是server端的报错信息:io.netty.handler.codec.CorruptedFrameException: Max frame length of 65536 has been exceeded
client端时有分片分批传输的,调小了区间是可以正常使用的,只是我想把大小设的稍微大一点,这样分块分的太多了,所以想知道是否有可以直接调整的配置项和方法可用
好的,了解.
这个65536的最大帧载荷长度是为了防止客户端使用大数据量来进行拒绝服务型攻击(Denial-of-Service Attacks).
下个版本将会增加此配置项,预计0点后即可在maven**仓库下载
from netty-websocket-spring-boot-starter.
是的,谢谢,确实是可以在那个初始化的时候设置这个最大帧载荷长度,如果可以灵活配置的话就更好了
from netty-websocket-spring-boot-starter.
好的,谢谢
from netty-websocket-spring-boot-starter.
Related Issues (20)
- BeforeHandshake关闭session后,nginx转发http响应的502 HOT 2
- 想问下服务器如何判断客户端掉线,然后通知他的好友 HOT 2
- writerIdleTimeSeconds配置使用${引用nacos配置},不能做到动态刷新 HOT 1
- 整合RocketMq后异常日志不全 HOT 2
- netty默认的Channel的通道id太长了,目前框架上支持这个id自定义吗? HOT 1
- 客户端断网后服务端不知道客户端断开了 HOT 1
- 请问如何处理数据库存储的客户端连接状态,假如单节点部署,重启过程中客户端离线,数据库的状态如何改变呢,有什么策略可以主动ping客户端吗 HOT 1
- 想问一下0.12版本客户端访问问题 HOT 1
- 使用@ServerEndpoint修饰但不用@Component时,其它Bean注入该Bean时会报 bean could not be found 异常 HOT 2
- 客户端在线,服务端离线 HOT 1
- 是否支持socketjs+stomp? HOT 1
- 连接报错,发送消息也报错。。。看内容吧。。。 HOT 3
- 能否支持自定义全局异常处理? HOT 1
- 能否进一步优化反射方法性能 HOT 1
- 0.12.0使用的netty版本和文档不一致 HOT 2
- 支持TCP吗?
- pojoClazz 不是单例的吗
- 不支持jdk17么?
- 支持SpringBoot3.2吗 HOT 1
- 如何控制@onClose的关闭时间
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from netty-websocket-spring-boot-starter.