如何将信息从 PHP 代理推送到 Flex 应用程序
所以我有一个 PHP 代理,可以从网站获取信息。假设代理从 (www.example.com) 获取信息。它检查返回的行数是否与之前相同,如果不是,则还有更多行,它计算差异,然后需要将此信息推送到 Flex 客户端,表示它有新信息,(x) 更多行有被写了。
我不太确定如何在 php 代理上执行推送机制,因为我不确定如何实际从代理推送到客户端,以前从未这样做过。有什么帮助吗?
So I have a PHP proxy that gets information from a website. Let's say the proxy gets the information from (www.example.com). It checks if the number of lines returned is the same as before, if not then there are more lines, it counts the difference then it need to push this information to the Flex client saying that it has new information, (x) more lines have been written.
I am not really sure how to do the push mechanism on the php proxy because I am not sure how to actually push from the proxy to the client, never done it before. Any help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
通常,您无法从服务器端发起传输。您可以
Normally, you cannot initiate a transfer from the server side. You can either
除非有开放的连接,否则您无法真正将任何内容从服务器推送到 Flash 应用程序。因此,您可以从代理请求号码,它会获取信息并将其返回给应用程序,或者打开自 AS3 以来可用的套接字连接。套接字连接一直保持到显式关闭为止,但这似乎只是为了发送一些信息而太过分了。
You can't really push anything from the server to your flash application unless you have an open connection. So you can either request the number from the proxy it fetches the info and gives it back to the app, or open a socket connection which is available since AS3. The socket connection stays up until explicitly closed, but that seems an overkill just for sending some info.