I have a Flash client that I want to connect to a server. Both are using localhost and port 50000 so there shouldn't be any cross-domain problems. I also set Access Network Only in the publishing settings. When I call the XMLSocket connect, the server seems to get a new connection. But, the XMLSocket.onConnect callback is not called with success=true.
Any ideas on what may be wrong?
Here's the ActionScript for creating the socket.
function myOnConnect(success) {
if (success) {
trace ("Connection succeeded!")
inputText.text = "open";
// socket.send("1\n");
gotoAndPlay(2);
} else {
trace ("Connection failed!")
inputText.text = "failed";
}
}
btnConnect.onRelease = function()
{
inputText.text = "started";
result = socket.connect("localhost", 50000);
}
socket = new XMLSocket();
socket.onConnect = myOnConnect;