`
adapterofcoms
  • 浏览: 75958 次
  • 性别: Icon_minigender_1
  • 来自: 苏州
社区版块
存档分类
最新评论

AS3 specials

阅读更多

 

1.flash.net.Socket/XMLSocket

Security.loadPolicyFile(((("xmlsocket://" + domain) + ":") + port));

发送的请求: <policy-file-request/>\0 

注意响应的crossdomain.xml:

<?xml version=\"1.0\" encoding=\"UTF-8\"?>

<cross-domain-policy>

<site-control permitted-cross-domain-policies=\"all\" />

<allow-access-from domain=\"*\" to-ports=\"*\" />

<allow-http-request-headers-from domain=\"*\" headers=\"*\"/>

</cross-domain-policy>\0 

http: Security.loadPolicyFile("http://www.domain.com/crossdomain.xml")

注意: XMLSocket并非传输的一定是xml document.  记得 new XML(event.data),还有\r\0 结尾.

XMLSocket.send(object to string+\0) .

 

2.ExternalInterface.available 判断是必要的,在浏览器环境 or 在flashplayer环境.

 

3.ByteArray.bytesAvailable,Socket.bytesAvailable,如果read方法要读取的字节数超过bytesAvailable,
那么Error #2030 .在Socket(not XMLSocket) data handle的时候由于网络,传输的数据量多等原因很容易出现这种情况.这就有可能造成数据在传输上产生碎片片段,比如一个完整的消息有可能会触发多次 socket data handle Event.相比而言,XMLSocket更易用.

分享到:
评论

相关推荐

    vb 数字转换为英文字母

    result = NumberToWords(thousands) & " " & Specials(result.Length Mod 3) & " " End If num = num Mod 1000 result = GetWordForNumber(num) & " " & result Loop NumberToWords = Left(result, Len(result...

    GraphicExD for Delphi 2007,2009

    This library is primarily designed to load images as background (buttons, forms, toolbars) and textures (DirectX, OpenGL) or for image browsing and editing purposes as long as you don't need to save ...

    sap 的Logon的几个参数

    4. login/min_password_specials 定义密码中特殊字符的最小数量。特殊字符包括!"@$%&/()=?'`*+~#-_.,;:{[]}\|和空格。在SAP NetWeaver 6.40及更高版本中,所有非字母和数字字符都被视为特殊字符。默认值为0,允许...

    新目标英语七下全册课堂15分钟练习提高作业及答案108精选.doc

    - "We also have great variety as well as drinks."(我们还有各种各样的饮料。) - "We have some iced tea, too."(我们也有一些冰茶。) - "Write your own advertisement for pizza and drinks."(为披萨和...

Global site tag (gtag.js) - Google Analytics