PDA

View Full Version : problem in Local Connection


rohitmanglik
10-24-2009, 03:31 PM
I am trying to create one to one chat in my project. For that i created a localConnection object and send message to other clients. the client receives the message can send back the reply.
Everything is working fine when I opened two different browsers with connection through apache server (localhost), it went ok.But when I tries to run one client in one computer and other in different computer, message doesnt pass , and the weird thing is ,it doesnt show any error.

I included the crossdomain file
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*" />
</cross-domain-policy>

Code for connection i made
conn = new LocalConnection();
conn.client = this;
conn.connect("myConnection");
conn.allowDomain("*");
conn.allowInsecureDomain();

also i included the following code in initialize connection
flash.system.Security.loadPolicyFile("../crossdomain.xml");
flash.system.Security.allowInsecureDomain("*");
flash.system.Security.allowDomain("*");

But nothing works...... Please help

Rohit Manglik
+919743083301

kdittyr
11-05-2009, 08:12 PM
local connection is used when trying to communicate between two or more swf's on one computer. It is not used (alone) when trying to talk to another client on another computer.

You may want to look into a socket connection to handle a chat program. Or xmlSocket.