Coder Social home page Coder Social logo

Comments (7)

beetlex-io avatar beetlex-io commented on June 14, 2024

websocket默认最大的数据包是1M,你的场景同时向很多连接发送一个大的数据包?

from fasthttpapi.

zhusheping avatar zhusheping commented on June 14, 2024

image

只向一个链接发送了一次很小的数据量。
发送后的瞬间内存就上去了。
image

from fasthttpapi.

zhusheping avatar zhusheping commented on June 14, 2024

image
客户端用的是本地的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.

beetlex-io avatar beetlex-io commented on June 14, 2024

@zhusheping
方便的话把代码打包到发到[email protected]邮箱,以上代码没发现异常。

from fasthttpapi.

beetlex-io avatar beetlex-io commented on June 14, 2024

@zhusheping
针对你描述的情况修改一下sample的代码,暂没发现你说的情况
https://github.com/IKende/FastHttpApi/tree/master/samples/HttpApiServer.WebSocket

from fasthttpapi.

beetlex-io avatar beetlex-io commented on June 14, 2024

@zhusheping
本地没有core 3.0,用2.2测试没问题
https://ikende.com/Files/TestFastHttpApi.rar

from fasthttpapi.

zhusheping avatar zhusheping commented on June 14, 2024

from fasthttpapi.

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.