Jump to content
  • Advertisement
Sign in to follow this  
Seriema

[web] Flash XMLSocket disconnection problem

This topic is 4358 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I must send some data from Flash to an executable and now I'm trying to do it through a local connection. I'm trying to connect to a HttpListener made in VB. It detects a connection from browsers when going to the defined adress and port. But when using the only socket I could find i Flash 8, ActionScript 2.0's XMLSocket, it closes the connection right after the send() call and the HttpListener doesn't detect anything so I'm guessing the send call failed (odd way to implement a send function, no callback or return value). Here's the code I'm using
mySocket = new XMLSocket();
mySocket.onConnect = function(success) {
	if (success) {
		trace("Server connection established!");
	} else {
		trace("Server connection failed!");
	}
};
mySocket.onClose = function() {
	trace("Server connection lost");
};
XMLSocket.prototype.onData = function(msg) {
	trace(msg);
};
mySocket.connect("1.2.3.4", 1337); // real address omitted here

function sendData() {
	trace("sending data");
	var theData = "<b>testdata</b>";
	mySocket.send(theData);
	trace("sent data");
}



The sendData() function is called when I press a button. If I stick a getUrl(...) it throws up Explorer and the HttpListener detects it. Why does the connection get lost? [Edited by - Seriema on October 19, 2006 7:21:26 AM]

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!