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

Login:
Pass:
 
 

Original thread:
Post 12 made on Tuesday March 24, 2009 at 22:42
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
13,002
On March 23, 2009 at 23:42, Barry Gordon said...
Could be, as I said I always qualify a reference so I would never know

Me too. But it makes it nice to know because a socket is nothing more than a javascript object so you can attach the partial response string to a member field of the socket such that you don't need extra variable.

socket.onData = function()
{
this.partialData += this.read();
// check partial data and if end of message is complete extract your part,
// process and clear partial data.
var toRemove = processMessage(this.partialData);
this.partialData = this.partialData.substring(toRemove);
}
Lyndel McGee
Philips Pronto Addict/Beta Tester


Hosting Services by ipHouse