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

wip

parent f661064a
No related branches found
No related tags found
No related merge requests found
...@@ -114,7 +114,6 @@ function getPairings(machines) { ...@@ -114,7 +114,6 @@ function getPairings(machines) {
socket.on("message", function(message, rinfo) { socket.on("message", function(message, rinfo) {
const text = message.toString().split(" "); const text = message.toString().split(" ");
if (text[0] === "init") { if (text[0] === "init") {
// console.log("GOT INIR");
getPairings(machines); getPairings(machines);
} }
if (text[0] === "join") { if (text[0] === "join") {
......
...@@ -92,13 +92,11 @@ function syn(machineNumberBeingChecked) { ...@@ -92,13 +92,11 @@ function syn(machineNumberBeingChecked) {
function ack(synIP, address) { function ack(synIP, address) {
const message = Buffer.from(`ack ${machineNumber}`); const message = Buffer.from(`ack ${machineNumber}`);
// console.log("ack " + machineNumber + " " + message.toString() )
socket.send(message, 0, message.length, PORT, address, function() {}); socket.send(message, 0, message.length, PORT, address, function() {});
} }
function synAll() { function synAll() {
Object.keys(connections).forEach(connection => { Object.keys(connections).forEach(connection => {
// console.log(connection)
syn(connection) syn(connection)
}) })
} }
...@@ -106,7 +104,6 @@ function synAll() { ...@@ -106,7 +104,6 @@ function synAll() {
function sendMessage() { function sendMessage() {
const message = JSON.stringify(connections); const message = JSON.stringify(connections);
socket.send(message, 0, message.length, CLI_PORT, CLI_HOST, function() {}); socket.send(message, 0, message.length, CLI_PORT, CLI_HOST, function() {});
// console.log(connections)
} }
function updateTimeStamp(ackMachineNumber) { function updateTimeStamp(ackMachineNumber) {
...@@ -158,7 +155,6 @@ socket.on("message", function(message, rinfo) { ...@@ -158,7 +155,6 @@ socket.on("message", function(message, rinfo) {
console.log("") console.log("")
} }
if (text[0] === "check") { if (text[0] === "check") {
// console.log("GOT check")
ack(text[1], rinfo.address) ack(text[1], rinfo.address)
} }
if (text[0] === "ack") { if (text[0] === "ack") {
......
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