实时更新,并在AS3推入数据并在、实时、数据

2023-09-09 21:23:16 作者:爱到深处腿自开-

我想为我的Flash应用程序的实时更新。相反,就使得它刷新每个30secs,我想preFER推技术。什么是推动ActionScript 3中数据的最佳方式是什么?

i want to make a real-time update for my flash application. Instead on making it refresh each 30secs, i would prefer the push technology. What is the best way to push data in Actionscript 3 ?

推荐答案

有两种流行的方法实现实时更新:插座和​​RTMP。有优点和缺点每个,但主要决定因素通常是你的服务器基础设施。

There are two popular options for implementing real-time updates: sockets and RTMP. There are advantages and disadvantages to each, but the primary deciding factor is usually your server infrastructure.

插槽

套接字提供最低级别的功能。这意味着你将需要实现在客户端和服务器上的code的协议。但是,这种方法的最大优点是它可工作,支持TCP / IP套接字的任何服务器端技术。您可以发送任何格式的你喜欢的数据,但最有效的是使用的动作消息格式的(AMF)来传输数据的二进制格式。

Sockets provide the lowest-level functionality. This means you will need to implement a protocol in code on the client and on the server. However, the biggest advantage of this approach is that the it can be made to work any server-side technology that supports TCP/IP sockets. You can send data in whichever format you like, but the most efficient would be to use ActionScript Message Format (AMF) to transfer the data in binary format.

RTMP

实时媒体协议是由Adobe开发和本地的实施方案Flash播放器。使用RTMP将需要能够支持该协议的一个特定的服务器。有专有的解决方案,以及免费的。使用RTMP的优势是,大部分的协议已经落实,并共享数据可以很简单,比如设置一个共享对象的价值 - 与协议处理幕后的数据传输。 RTMP连接$ c。使用AMF使带宽使用$ CS的消息是有效的。该协议还支持隧道通过HTTP,这意味着它诉诸投票通过HTTP当RTMP连接是不可能的。

Real-Time Media Protocol is a protocol developed by Adobe and implemented natively by the Flash Player. Using RTMP would require a specific server which can support the protocol. There are proprietary solutions, as well as free ones. The advantage of using RTMP is that much of the protocol is already implemented, and sharing data can be as simple as setting the value of a shared object - with the protocol handling the data transfer behind the scenes. RTMP encodes messages using AMF so bandwidth usage is efficient. The protocol also supports "tunneling" over HTTP, which means it resorts to polling over HTTP when an RTMP connection is not possible.

下面是一些服务器端解决方案实现RTMP和/或AMF:

Here are some server-side solutions for implementing RTMP and/or AMF:

FluorineFX (.NET) 的WebORB (.NET,Java和PHP) 的Red5 (爪哇) Adob​​e Flash媒体服务器(爪哇) FluorineFX (.Net) WebORB (.Net, Java, PHP) Red5 (Java) Adobe Flash Media Server (Java)

这篇文章在维基百科详细描述了RTMP协议和可用的服务器。

This entry on Wikipedia describes the RTMP protocol and available servers in more detail.