本文介绍了闪存套接字,对等功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

快速介绍:我们已经完成了一个快速的俄罗斯方块游戏,我们正在寻找添加多人游戏功能。在对闪存和插座的功能进行了几天的研究后,我感到更加困惑。一个快速的免责声明,我是新来的套接字/网络一般。

从我在网上收集,一般闪光tcp套接字不能处理对等连接由于政策系统到位。为了让flash做p2p,必须使用支持RTMFP的服务器(如闪存媒体服务器等)来处理初始握手,并且从那里开始,闪存就能够以p2p方式传递数据。



编辑:请看第一个问题的全面更新的答案。

解决方案

1)对于套接字策略,使用我的Perl脚本或Apache模块(两者都很好): - 它将服务客户端连接到端口843.



但这是不够的,因为防火墙/代理服务器后面的公司用户 - 谁不能连接到端口843,所以你也需要将套接字策略处理添加到你自己的服务器代码中(即响应输入的< policy-file-请求/> \0 请求)。



2)对于RTMFP - 不要这样做,因为:



a)Cirrus不是一个选项,因为它是测试版,不用于商业用途。另外它似乎已经过时了FMS4,所以在它停止之前有多久了?b)b)Flash Media Server 4选项非常昂贵。对于企业版本(RTMFP所需),Adobe甚至不公开列出价格。您唯一的选择是AWS的FMS4,但也是昂贵的:

有一个用于RTMFP的OSS项目,但还没有准备好:OpenRTMFP Cumulus



d)对于一些用户来说RTMFP只是不起作用所以我的建议是使用RTMP / RTMPT为所有用户,包括公司的,并使用Red5的:


Quick Intro: We have a flash tetris game finished and we are looking to add multiplayer functionality to the game. After a few days of research on the capabilities of flash and sockets, I've gotten even more confused. A quick disclaimer, I am new to sockets/networking in general.

From what I gathered online, general flash tcp sockets cannot handle peer to peer connections due to the policy system in place. In order for flash to do p2p, one must use a RTMFP-capable server (such as flash media server, etc) to deal with the initial handshakes and from there, flash is able to pass data in a p2p fashion.

Edit: See the first answer for a comprehensive update on the question.

解决方案

1) For socket policy take my Perl-script or the Apache module (both work well): http://code.google.com/p/mod-socket-policy/ - it will serve clients connecting to the port 843.

But this is not enough because of corporate users behind firewalls / proxies - who can't connect to port 843, so you need to add socket policy handling to your own server code too (i.e. respond to incoming <policy-file-request/>\0 requests).

2) For RTMFP - don't do it, because:

a) Cirrus is not an option, because it is beta and not for commercial use. Also it seems to be outdated by the FMS4, so how long before it's discontinued?

b) Flash Media Server 4 option is very expensive. For the enterprise version (required for RTMFP) Adobe doesn't even list the price publicly. Your only option is FMS4 for AWS, but it is expensive too: adobe media server 4 cost with amazon?

c) There is an OSS project for RTMFP, but it isn't ready yet: OpenRTMFP Cumulus

d) For some users RTMFP just doesn't work

So my suggestion is to go with RTMP/RTMPT which works for all users, incl. corporate ones and use Red5 for that: http://red5.org/

这篇关于闪存套接字,对等功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 20:40
查看更多