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);
}