gpt4 book ai didi

c# - 实时显示数据的替代选项

转载 作者:行者123 更新时间:2023-11-30 13:58:51 25 4
gpt4 key购买 nike

我们有一个 ASP.NET 网络应用程序需要实时显示数据或最好的 s,我们目前正在使用 AJAX 和网络服务,但这会导致性能问题,因为客户端数量越来越大。数据每 5-10 秒汇集一次,当这乘以 1000 多个客户端时,数据检索会变得非常慢。

最佳答案

您可能想尝试使用 SignalR处理您的实时数据需求。来自网站:

ASP.NET SignalR is a new library for ASP.NET developers that makes it incredibly simple to add real-time web functionality to your applications. What is "real-time web" functionality? It's the ability to have your server-side code push content to the connected clients as it happens, in real-time.

You may have heard of WebSockets, a new HTML5 API that enables bi-directional communication between the browser and server. SignalR will use WebSockets under the covers when it's available, and gracefully fallback to other techniques and technologies when it isn't, while your application code stays the same.

SignalR also provides a very simple, high-level API for doing server to client RPC (call JavaScript functions in your clients' browsers from server-side .NET code) in your ASP.NET application, as well as adding useful hooks for connection management, e.g. connect/disconnect events, grouping connections, authorization.

关于c# - 实时显示数据的替代选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15068995/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com