On October 26, 2009 at 02:31, Janci said...
How can I find if there is in asynchronous communications a connection? When I had synchronous communication and there was not connection, I could see in my debug page error connection, but when I u se debug page in asynchronous there is nothing.
Something like:
var s = new TCPSocket(false);
s.onConnect = function () {
System.print("Yippie! I got a connection!");
};
s.onIOError = function (e) {
System.print("Oh no, something went wrong: " + e);
};
s.onClose = function () {
System.print("The connection got closed");
};
s.onData = function () {
var data = this.read();
System.print("Received " + data.length + " bytes of data");
};
s.connect("192.168.1.101", 80, 6000); // edited to add 2nd param of port 80
Last edited by Lyndel McGee (moderator) on October 26, 2009 21:53.