我在端口2400上设置了一个服务。当我从Flash本身运行Flash客户端时,它运行正常,因为它绕过了安全策略。
当我尝试通过在桌面上运行SWF或从浏览器进行连接时,我看到了这个交换:
00000000 3c 70 6f 6c 69 63 79 2d 66 69 6c 65 2d 72 65 71 <policy- file-req
00000010 75 65 73 74 2f 3e 00 uest/>.
00000000 3c 3f 78 6d 6c 20 76 65 72 73 69 6f 6e 3d 22 31 <?xml ve rsion="1
00000010 2e 30 22 3f 3e 3c 21 44 4f 43 54 59 50 45 20 63 .0"?><!D OCTYPE c
00000020 72 6f 73 73 2d 64 6f 6d 61 69 6e 2d 70 6f 6c 69 ross-dom ain-poli
00000030 63 79 20 53 59 53 54 45 4d 20 22 68 74 74 70 3a cy SYSTE M "http:
00000040 2f 2f 77 77 77 2e 61 64 6f 62 65 2e 63 6f 6d 2f //www.ad obe.com/
00000050 78 6d 6c 2f 64 74 64 73 2f 63 72 6f 73 73 2d 64 xml/dtds /cross-d
00000060 6f 6d 61 69 6e 2d 70 6f 6c 69 63 79 2e 64 74 64 omain-po licy.dtd
00000070 22 3e 20 3c 63 72 6f 73 73 2d 64 6f 6d 61 69 6e "> <cros s-domain
00000080 2d 70 6f 6c 69 63 79 3e 20 3c 73 69 74 65 2d 63 -policy> <site-c
00000090 6f 6e 74 72 6f 6c 20 70 65 72 6d 69 74 74 65 64 ontrol p ermitted
000000A0 2d 63 72 6f 73 73 2d 64 6f 6d 61 69 6e 2d 70 6f -cross-d omain-po
000000B0 6c 69 63 69 65 73 3d 22 6d 61 73 74 65 72 2d 6f licies=" master-o
000000C0 6e 6c 79 22 2f 3e 20 3c 61 6c 6c 6f 77 2d 61 63 nly"/> < allow-ac
000000D0 63 65 73 73 2d 66 72 6f 6d 20 64 6f 6d 61 69 6e cess-fro m domain
000000E0 3d 22 2a 22 20 74 6f 2d 70 6f 72 74 73 3d 22 2a ="*" to- ports="*
000000F0 22 20 2f 3e 3c 2f 63 72 6f 73 73 2d 64 6f 6d 61 " /></cr oss-doma
00000100 69 6e 2d 70 6f 6c 69 63 79 3e 00 in-polic y>.
所以你可以看到我在响应中正确包含了null终止符。
交换服务的策略请求和策略文件后,会发生以下情况:
我假设这是客户端连接(步骤1-3)然后中止(步骤4-6)。 Flash提供此错误:
Error: Error #2048: Security sandbox violation: file:///C|/Projects/rbrnascar/trunk/Development/Websites/flash/SocialMap.swf cannot load data from robpaveza.net:2400. at com.redbull.model::SocialMapModel/onSecurityError() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at flash.net::Socket/onTimeout() at flash.utils::Timer/_timerDispatch() at flash.utils::Timer/tick()
我看过以下页面,这些页面似乎表达了类似的麻烦,但没有解决方案
有人想出来了吗?
答案 0 :(得分:0)
以下是我将如何做到这一点(用C#写入StreamWriter)
mwriter.WriteLine(XMLString+"\0");
答案 1 :(得分:0)
确保客户端的超时设置为毫秒,而不是秒。