diff --git a/config.js b/config.js index 0209cf1..888ab55 100644 --- a/config.js +++ b/config.js @@ -9,7 +9,7 @@ module.exports = { webrtc_port_begin: parseInt(process.env.WEBRTC_PORT_BEGIN), session_limit: 100, log_path: "./logs/runtime.log", - webrtc_server_path: "C:/Users/c/Documents/Projects/pixel-streaming-webrtc/WebServers/SignallingWebServer/cirrus.js", + webrtc_server_path: "../pixel-streaming-webrtc/WebServers/SignallingWebServer/cirrus.js", app_args: { runtime: { port: "-PixelStreamingPort=" diff --git a/src/modules/port_alloc.js b/src/modules/port_alloc.js index 8ee66ba..275c488 100644 --- a/src/modules/port_alloc.js +++ b/src/modules/port_alloc.js @@ -38,51 +38,3 @@ module.exports = { get_webrtc_port, get_app_port } - -// class port { -// constructor(value) { -// this.#value = value -// this.#free = true -// } -// get_value() { -// return this.#value -// } -// set_free() { -// this.#free = true -// } -// set_busy() { -// this.#free = false -// } -// is_free() { -// return this.#free -// } -// #value -// #free -// } - -// class port_alloc { -// constructor(port_begin, count) { -// this.#ports = new Array() -// for (var i = port_begin; i < port_begin + count; ++i) { -// this.#ports.push(new port(i)) -// } -// } -// get() { -// for (var i in this.#ports) { -// if (this.#ports[i].is_free()) { -// this.#ports[i].set_busy() -// return this.#ports[i].get_value() -// } -// } -// throw new Error('no free ports') -// } -// free(busy_port) { -// for (var i in this.#ports) { -// if (this.#ports[i].get_value() == busy_port) { -// this.#ports[i].set_free() -// return -// } -// } -// } -// #ports -// } \ No newline at end of file diff --git a/tests/config.js b/tests/config.js index b62c9c6..a2a9f6b 100644 --- a/tests/config.js +++ b/tests/config.js @@ -1,4 +1,5 @@ -var config = require('../config') +const config = require('../config') +const fs = require('fs') const not_valid = (message) => { console.error('not valid (config.js): ', message) @@ -57,6 +58,13 @@ const test_config = () => { config_pass = false } + if (config.webrtc_server_path) { + if (!fs.existsSync(config.webrtc_server_path)) { + not_valid('wbertc_server_path exists in config BUT not in the filesystem (file not exists)') + config_pass = false + } + } + if (!config.app_args) { not_valid('webrtc_server_path') config_pass = false