Hello Flexcoders;

 

Is there a way to know when SecurityPolicy.loadPolicyFile( ) has completed?

 

A little background: our Flex application needs to communicate with another application running on the same machine. We are using an XML socket to host the communication. When the user clicks the buttons that exposes this functionality, a Cairngorm command is executed that does the following:

 

1)       Call SecurityPolicy.loadPolicyFile(). The server responds with a <cross-domain-policy-file> XML document.

2)       Create an XML socket on the same IP address and port as specified in the loadPolicyFile() call.

3)       Send a small XML file to the socket.

4)       The server closes the socket.

 

I’m running into a problem where the send() operation on a socket returns successfully, but fails to send any data. This only happens if I call SecurityPolicy.loadPolicyFile() immediately before calling socket.connect(). If I use a timer to delay the send() call 500ms after the loadPolicyFile(), there is no problem.

 

The docs state:

 

When considering a request that requires a policy file, Flash Player always waits for the completion of any policy file downloads before denying a request

 

But this had not been my experience.  Well, I guess the send() operation is not denied, it’s just never executed.

 

My solution right now is to use a timer to delay the send() operation, but this feels like a nasty hack. Is there a better way?

 

Thanks.
Tobias.

Kodak Graphic Communications Canada Company

Tobias Patton | Software Developer | Tel: +1.604.451.2700 ext: 5148 | mailto:[EMAIL PROTECTED] | http://www.creo.com

 

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to