Skip to content
Snippets Groups Projects
Commit 937022b5 authored by arshiam2's avatar arshiam2
Browse files

wip

parent 651648e3
Branches master
No related tags found
1 merge request!2WIP: Old 4
...@@ -149,8 +149,8 @@ socket.on("message", function(message, rinfo) { ...@@ -149,8 +149,8 @@ socket.on("message", function(message, rinfo) {
if (text[0] === "dead") { if (text[0] === "dead") {
console.log(text) console.log(text)
console.log(text[1].toString()[0]) console.log(text[1].toString()[0])
machines = machines.filter(m => m.toString()[0] !== text[1].toString()[0]); // machines = machines.filter(m => m.toString()[0] !== text[1].toString()[0]);
console.log(machines) // console.log(machines)
} }
}); });
...@@ -118,7 +118,7 @@ function updateTimeStamp(ackMachineNumber) { ...@@ -118,7 +118,7 @@ function updateTimeStamp(ackMachineNumber) {
function updateStatuses() { function updateStatuses() {
Object.keys(connections).forEach(connection => { Object.keys(connections).forEach(connection => {
if (Date.now() - connections[connection].timestamp >= 2000) { if (Date.now() - connections[connection].timestamp >= 2000 && connections[connection].timestamp != 0) {
connections[connection].status = "dead" connections[connection].status = "dead"
const message = Buffer.from(`dead ${connection}`); const message = Buffer.from(`dead ${connection}`);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment