Git Product home page Git Product logo

Comments (8)

YeautyYE avatar YeautyYE commented on May 18, 2024 2

0.7.3版本中增加了maxFramePayloadLength属性,进行配置即可.
预计0点后可在maven**仓库下载
或者直接clone源码install到本地仓库

from netty-websocket-spring-boot-starter.

YeautyYE avatar YeautyYE commented on May 18, 2024

没有现成的配置可以直接设置这个值
因为考虑到部分场景,连接数与真实的资源消耗并不是绝对的正比,直接限制连接数并不能带来最好的效果,而设置backlog(与Netty中的backlog一致)将是一个更好的选择.

如果需要限制session的最大大小,可以很简单的实现
如:在@serverendpoint的类里面加入AtomicInteger类型的全局变量来进行限制.(连接成功时+1,关闭时-1.当数量超过限制时强制关闭)

from netty-websocket-spring-boot-starter.

xiaodengchao avatar xiaodengchao commented on May 18, 2024

我是指如果我把文件流在@onbinary中传递时太大的文件流会直接断掉,不是指限制连接数,可能我之前的表述有问题把

from netty-websocket-spring-boot-starter.

YeautyYE avatar YeautyYE commented on May 18, 2024

如果是server有限制,会报错,可以看下报错信息.
或者是否client对每次消息大小有限制

另外,具体文件大小是多少

from netty-websocket-spring-boot-starter.

xiaodengchao avatar xiaodengchao commented on May 18, 2024

这是server端的报错信息:io.netty.handler.codec.CorruptedFrameException: Max frame length of 65536 has been exceeded
client端时有分片分批传输的,调小了区间是可以正常使用的,只是我想把大小设的稍微大一点,这样分块分的太多了,所以想知道是否有可以直接调整的配置项和方法可用

from netty-websocket-spring-boot-starter.

YeautyYE avatar YeautyYE commented on May 18, 2024

这是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.

xiaodengchao avatar xiaodengchao commented on May 18, 2024

是的,谢谢,确实是可以在那个初始化的时候设置这个最大帧载荷长度,如果可以灵活配置的话就更好了

from netty-websocket-spring-boot-starter.

xiaodengchao avatar xiaodengchao commented on May 18, 2024

好的,谢谢

from netty-websocket-spring-boot-starter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.