There is no reason to create the client message every iteration. It's the same message.
Do it once before the loop and then just send it to each client.
See code in the previous issue that was closed.
for(var i in wsClients){
//if(clients[i]!=connection)
var lat = msgArray[1];
var lon = msgArray[2];
var alt = msgArray[3];
var heading = msgArray[4]_Math.PI/180;
var pitch = (msgArray[5] - 90)_Math.PI/180;
var roll = msgArray[6]*Math.PI/180;
There is no reason to create the client message every iteration. It's the same message. Do it once before the loop and then just send it to each client. See code in the previous issue that was closed.
for(var i in wsClients){ //if(clients[i]!=connection) var lat = msgArray[1]; var lon = msgArray[2]; var alt = msgArray[3]; var heading = msgArray[4]_Math.PI/180; var pitch = (msgArray[5] - 90)_Math.PI/180; var roll = msgArray[6]*Math.PI/180;