Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Previous section Next section Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Topic:
Managing two IP sockets in one activity
This thread has 5 replies. Displaying all posts.
Post 1 made on Friday July 2, 2010 at 06:41
multimedia
Long Time Member
Joined:
Posts:
December 2006
111
I'm using an asynchronious socket in the activity script, that is only opened once when entering in the activity. Another synchronious socket is used in the page script.
Everything is working fine unless the asynchronious socket cannot connect. Even though the timeout is set to 3000ms, this "try to connect" is blocking during 45 seconds the connection of the synchronious socket in the page script.

I also made sure that the synchronious socket connect is called only when the timeout of the asynchronious connect was lapsed. (Even though Barry has mentioned in one post, that he even leaves an asynchronious socket open when he connects with another socket)

The IOError Callback of the asynchronious try to connect is executed only after these 45 seconds. No way to prevent the 45 seconds blocking for the synchronious connection in the page script.

I'm using the newest firmware.

Any suggestions appreciated. Thanks very much!

Last edited by multimedia on July 2, 2010 06:55.
Post 2 made on Friday July 2, 2010 at 18:41
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,996
Also, please post snippets of your script such as how you created the socket and whether or not you have assigned an onConnect function. If you did not assign onConnect function, this might be the issue but I'm leaning towards it being a bug or something else. Also, are you connecting to host by name or by IP? If by name, it could be the DNS lookup that is causing the issue. The only way I can say for sure is if you can provide snippet of your code.

You may also want to send email with small config illustrating problem and detailed explanation to the ProntoTeam. Lookup their email addy from RC account here if you don't know it.
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 3 made on Saturday July 3, 2010 at 03:42
multimedia
Long Time Member
Joined:
Posts:
December 2006
111
Thanks Lyndel,
even without snippets you've solved this issue.
It has been the DNS lookup. Instead of the name I put the fixed IP to connect.

However I do not understand, why the timeout for the asynchronious connect doesn't through an IOError, when it has been lapsed?
Post 4 made on Saturday July 3, 2010 at 07:19
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,996
Me either. As you already have a larger config that exhibits the problem, if you could, please, put an email and small config together that exhibits the problem and ship to the team as I agree that if you say 3 seconds, it should take at most 3 seconds.
Lyndel McGee
Philips Pronto Addict/Beta Tester
Post 5 made on Saturday July 3, 2010 at 10:03
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,996
Can you please post the exact line of code you are using to do connect that causes 45 second timeout for DNS lookup?

I have asked Belgium to have a look so if you can please post, that would be grand. Thanks :-)
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 6 made on Saturday July 3, 2010 at 13:25
multimedia
Long Time Member
Joined:
Posts:
December 2006
111
Yes, of course I'll put the code, however it's quite basic:

Activity script:

var synSocket;
var asynSocket;

asynSocket = new TCPSocket(false);

asynSocket.onConnect = function()
{
System.print("connected");
}

asynSocket.onClose = function()
{
System.print("disconnected")
}

asynSocket.onIOError = function(e)
{
System.print("Error "+e);
}

if (asynSocket.connected == false)
{
//putting 'xml.weather.com' instead of the IP will block the syn socket connection in the page script, if there is no internet access
asynSocket.connect('65.207.183.129', 80, 3000);
}

Page Script:

synSocket = new TCPSocket(true);
synSocket.connect('192.168.0.100', 12000, 500);
socket.write(String.fromCharCode(0xF0, 0xF1, 0xF2));
var data = socket.read(1000,500);
synSocket.close();

Thanks again Lyndel, you really saved me a lot of time !


Jump to


Protected Feature Before you can reply to a message...
You must first register for a Remote Central user account - it's fast and free! Or, if you already have an account, please login now.

Please read the following: Unsolicited commercial advertisements are absolutely not permitted on this forum. Other private buy & sell messages should be posted to our Marketplace. For information on how to advertise your service or product click here. Remote Central reserves the right to remove or modify any post that is deemed inappropriate.

Hosting Services by ipHouse