Now we have a web application that runs on the local network, where clients run everything in javascript. To make sure everything is in sync, these clients are currently using an AJAX request to the server by sending the last "syncId" they received. The server then responds with a tree of command arrays to update this client. This is done every second and still causes any problems with network bandwidth or latency, however we are installing the system in a larger client next month, which may cause limitations of this method, and I am wondering if it is possible to have a PUSH server in sync Events with clients in real time.
srvResponse=httpGet("CDSSync.php?sessionKey="+sessionKey+"&lastUpdate="+lastUpdate);
if(srvResponse!=0){
syncEvents=srvResponse.split(";");
for(var i=0; i<syncEvents.length; i++){
syncItem=syncEvents[i].split(",");
window["syncFunction_"+syncItem[1]](syncItem[2]);
lastUpdate=syncItem[0];
}
}
Run codeHide result, syncItem [0] autoIncrement, syncItem [1] , syncItem [2] . httpGet, , , - , .