Hi Michael,

I have experience with this. Below I show you how to test via telnet.

It looks like you aren't serving up the policy file. You can test this via telnet. For instance, on Windows:
1) Click Start > Run , enter 'cmd' and hit ENTER
2) type the following and hit ENTER
telnet 213.32.122.227 80

If it worked you should see the policy file in the console. When I tried it I did not see your policy file.

Here is an example of ElectroServer serving up a policy file (run this line):
telnet electro-server.com 9875

You'll see that it spits out the policy file into the console.

Jobe Makar
http://www.electrotank.com
http://www.electro-server.com
phone: 252-627-8026
mobile: 919-609-0408
fax: 919-341-8104
----- Original Message ----- From: "Michael Nisi" <[EMAIL PROTECTED]>
To: <flashcoders@chattyfig.figleaf.com>
Sent: Thursday, June 22, 2006 4:11 PM
Subject: [Flashcoders] XMLSocket: load policy file and connect to port 80


Hi,

we have socket server running port 80, I need get a policy file through:
System.security.loadPolicyFile("xmlsocket://213.32.122.227:80");

The following class does work offline, but not online. How am I
supposed to debug this, as the System method to load the policy file
has no callback.

Has anyone experience with loading a policy file from and connecting to port 80?

Thanks,
Michael



import com.dynamicflash.utils.Delegate;
import mx.events.EventDispatcher;
import org.aikane.Aikane;
import auktion.Auktion;

/**
* AuktionConnector
*
* @author Michael Nisi ([EMAIL PROTECTED])
* @version 0.0.0 22.05.2006
*/
class auktion.business.AuktionConnector
{
   private static var instance:AuktionConnector;
   private static var socket:XMLSocket;
   private static var waitID:Number;
   private static var isConnected:Boolean;

   public static var CONNECT_EVENT:String = "connect";
   public static var CLOSE_EVENT:String = "close";
   public static var DATA_EVENT:String = "data";
   public static var XML_EVENT:String = "xml";

   private function AuktionConnector(Void)
   {
       EventDispatcher.initialize(this);

       socket = new XMLSocket();
       socket.onConnect = Delegate.create(this, onConnect);
       socket.onXML = Delegate.create(this, broadcast, XML_EVENT);
       socket.onClose = Delegate.create(this, onClose);
   }

   public static function getInstance(Void):AuktionConnector
   {
       Aikane.log("auktion.business.AuktionConnector", "getInstance:
"+instance);
       return instance || getNewInstance();
   }

   private static function getNewInstance(Void):AuktionConnector
   {
       instance = new AuktionConnector();
       return instance;
   }

   public function dispatchEvent(event:Object) {}
   public function addEventListener(type:String, listener):Void {}
   public function removeEventListener(type:String, listener):Void {}

   public function connect(host:String, port:Number):Void
   {
       Aikane.log(toString(), Auktion.POLICY_FILE);
       System.security.loadPolicyFile("xmlsocket://213.32.122.227:80");
       socket.connect(host, port);
       clearInterval(waitID);
       waitID = setInterval(this, "onConnect", 5000, false);
   }

   public function send(xml:XML):Void
   {
       socket.send(xml);
   }

   private function onConnect(success:Boolean, delegate:Function):Void
   {
       Aikane.log(toString(), "onConnect");
       clearInterval(waitID);
       if (success)
       {
           broadcast(success, CONNECT_EVENT);
       } else {
           broadcast(null, XML_EVENT);
       }
   }

   private function onClose(e, delegate:Function):Void
   {
       Aikane.log(toString(), "onClose");
   }

private function broadcast(data:Object, type:String, delegate:Function):Void
   {
       Aikane.log(toString(), "broadcast");
       dispatchEvent({ type:type, data:data, target:this });
   }

   private function toString(Void):String
   {
       return "auktion.business.AuktionConnector";
   }
}
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com



_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to