求xmlsocket 服務器安全策略通信協議 c語言寫的linux上可以用的謝謝了 另外
public function connect(_arg1:String, _arg2:int, _arg3:Boolean):void{
this.host = _arg1;
this.port = _arg2;
if (_arg3){
this.Debug.info(((("主播端連接ip:" + this.host) + "埠:") + this.port));
Security.loadPolicyFile("xmlsocket://127.0.0.1:1841");
this.socket.connect(this.host, _arg2);
} else {
Security.loadPolicyFile("xmlsocket://media.xxx.com:843");
this.Debug.info(("連接服務器IP:" + this.host));
this.socket.connect(this.host, _arg2);
};
}
public function write(_arg1:IMsgHead, _arg2:IMsgBody):void{
var _local3:ByteArray = new ByteArray();
_arg1.encode(_local3);
_arg2.encode(_local3);
var _local4:int = _local3.length;
_local3[1] = ((_local4 << 16) >> 24);
_local3[2] = ((_local4 << 24) >> 24);
Byte2Hex.Trace(_local3);
this.socket.writeBytes(_local3);
this.socket.flush();
}
public function onConnectSecurityError(_arg1:SecurityErrorEvent):void{
this.Debug.info(("獲取服務器認證 crossdomian 失敗:" + _arg1.errorID));
if (this.isLive){
Security.loadPolicyFile("xmlsocket://127.0.0.1:1841");
} else {
Security.loadPolicyFile("xmlsocket://media.xxx.com:8000");
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/112991.html
標籤:網絡及通訊開發
上一篇:如何撰寫5子棋游戲
