Comments (7)
websocket默认最大的数据包是1M,你的场景同时向很多连接发送一个大的数据包?
from fasthttpapi.
只向一个链接发送了一次很小的数据量。
发送后的瞬间内存就上去了。
from fasthttpapi.
客户端用的是本地的html。
<script type="text/javascript">
//检查浏览器是否支持WebSocket
if (!window.WebSocket) {
console.log('您的浏览器不支持WebSocket,请选择其他的浏览器再尝试连接服务器');
}
var el = document.getElementById("textarea");
var wsClient = new WebSocket('ws://localhost:9090');
wsClient.onopen = function(evt) {
console.log("Connection open ...");
wsClient.send("login:1");
wsClient.send("Hello WebSockets!");
};
wsClient.onclose = function (e) {
el.value += "连接断开!\r\n";
}
wsClient.onmessage = function (e) {
el.value += "接收消息:" + e.data + "\r\n";
}
wsClient.onerror = function (e) {
el.value += "连接失败!原因【" + e.data + "】\r\n";
}
</script>
from fasthttpapi.
@zhusheping
方便的话把代码打包到发到[email protected]邮箱,以上代码没发现异常。
from fasthttpapi.
@zhusheping
针对你描述的情况修改一下sample的代码,暂没发现你说的情况
https://github.com/IKende/FastHttpApi/tree/master/samples/HttpApiServer.WebSocket
from fasthttpapi.
@zhusheping
本地没有core 3.0,用2.2测试没问题
https://ikende.com/Files/TestFastHttpApi.rar
from fasthttpapi.
from fasthttpapi.
Related Issues (20)
- 关于注入问题的疑问 HOT 2
- 如何禁止ServerController? HOT 2
- Options 选项 AllowCredentials 无法设置 HOT 4
- context.Response.SameSite = None 请求无效 HOT 5
- 请问这类错误怎么排查: <send data completed error> HOT 1
- 大佬,为什么接收消息之后,buffer不释放 HOT 3
- 大佬,为什么配置了https之后,服务器返回的是403
- 可以更新到net core 7吗?
- 升级到net6或者net7 HOT 1
- Upload File Problem!
- CROS an Cookie Problem HOT 2
- WebSocket连接时能否传递参数
- 高版本不再开源了对吧?
- 我自定义了DataConvertAttribute 但并没有走。还是走的jsonDataConvert
- Wpf应用中集成FastHttpApi会导致Wpf弹窗问题,找不到xxx.resources.dll
- Accessing HttpRequest without route/map
- after update beetlex cannot run program with release mode HOT 1
- 有计划支持net core 8 吗
- how to add brotli compression ?
- 没有找到合适的方法去重写 HOT 1
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 fasthttpapi.