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

wip

parent 68a2a865
No related branches found
No related tags found
1 merge request!2WIP: Old 4
......@@ -145,4 +145,8 @@ socket.on("message", function(message, rinfo) {
machines = machines.filter(m => m.toString()[0] !== text[1]);
getPairings(machines);
}
if (text[0] === "dead") {
console.log(text)
}
});
......@@ -118,21 +118,21 @@ function updateTimeStamp(ackMachineNumber) {
function updateStatuses() {
Object.keys(connections).forEach(connection => {
if (Date.now() - connections[connection].timestamp >= (2 * 10000)) {
if (Date.now() - connections[connection].timestamp >= (5000)) {
connections[connection].status = "dead"
const message = Buffer.from(`dead ${connection}`);
console.log(message.toString())
console.log(Date.now() - connections[connection].timestamp)
// socket.send(
// message,
// 0,
// message.length,
// PORT,
// machineToIps[machineNumberBeingChecked.toString()[0]],
// function() {}
// );
socket.send(
message,
0,
message.length,
PORT,
machineToIps["1"],
function() {}
);
} else {
......
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