Skip to content
Snippets Groups Projects
Commit ca5b8022 authored by Patrick Wahl's avatar Patrick Wahl
Browse files

Fix issue with buffer checking

parent dd6c5a1b
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,6 @@ function Manager(self) { ...@@ -11,7 +11,6 @@ function Manager(self) {
this.addr_table = {}; this.addr_table = {};
this.buffer = []; this.buffer = [];
this.maxBufferSize = 252; this.maxBufferSize = 252;
this.delay = 1000; //ms
this.seenFloods = []; this.seenFloods = [];
this.checkBuffer = function() { this.checkBuffer = function() {
...@@ -31,7 +30,6 @@ function Manager(self) { ...@@ -31,7 +30,6 @@ function Manager(self) {
buff: 0 buff: 0
}; };
} }
setInterval(this.checkBuffer, this.delay);
}; };
this.printPorts = function() { this.printPorts = function() {
......
...@@ -3,6 +3,7 @@ var net = require("./network"), ...@@ -3,6 +3,7 @@ var net = require("./network"),
const startupDelay = 100; const startupDelay = 100;
const connectDelay = 100; const connectDelay = 100;
const bufferCheckDelay = 1000;
// INITIALIZE NETWORK TOPOLOGY HERE // INITIALIZE NETWORK TOPOLOGY HERE
var initTopology = [ var initTopology = [
...@@ -27,6 +28,9 @@ for (let i = 0; i < initTopology.length; i++) { ...@@ -27,6 +28,9 @@ for (let i = 0; i < initTopology.length; i++) {
this.delay(500, function() { this.delay(500, function() {
this.manager.printPorts(); this.manager.printPorts();
}); });
this.tick(bufferCheckDelay, function() {
this.manager.checkBuffer();
});
}); });
for (let j = 0; j < initTopology[i].length; j++) { for (let j = 0; j < initTopology[i].length; j++) {
if (initTopology[i][j] == -1) { if (initTopology[i][j] == -1) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment