Skip to content

Commit 14e80e9

Browse files
Christoph BodensteinChristoph Bodenstein
authored andcommitted
Added client ID support on server side
1 parent 2ed6056 commit 14e80e9

File tree

1 file changed

+6
-3
lines changed
  • TOEDistributionServer/src/node/tns/routes

1 file changed

+6
-3
lines changed

TOEDistributionServer/src/node/tns/routes/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var express = require('express'),
1212
formidable = require('formidable'),
1313
fs = require('graceful-fs'),
1414
path = require('path');
15-
var DEFAULT_SLEEPING_TIME = 1900;// in ms
15+
var DEFAULT_SLEEPING_TIME = 3000;// in ms
1616
var DEFAULT_MINIMUM_TIMEOUT = 500;//in sec
1717

1818
/* GET home page. */
@@ -175,7 +175,8 @@ router.get('/rest/api/downloads/ND', function (req, res) {
175175
var db = req.db;
176176
var simlist = db.collection('simlist');
177177
var activeclients = db.collection('activeclients');
178-
//console.log("Will remove old clients from list and answer the simulation request...");
178+
var clientID=req.param('ID');
179+
var clientSkills=req.param('SKILLS');
179180
removeOldClientsFromList(db, function (error) {
180181
//Nothing to do here...
181182
});
@@ -217,13 +218,15 @@ router.get('/rest/api/downloads/ND', function (req, res) {
217218
res.json({'success': false});
218219

219220
//Mark Request in DB for Statistics, count the clients waiting for tasks.
220-
activeclients.remove({ip: req.connection.remoteAddress}, function (err) {
221+
activeclients.remove({ip: req.connection.remoteAddress, id:clientID}, function (err) {
221222
if (err) {
222223
console.log("Error removing client from list.");
223224
}
224225

225226
activeclients.insert({
226227
ip: req.connection.remoteAddress,
228+
id: clientID,
229+
skills: clientSkills,
227230
timestamp: Date.now()
228231
}, function (err, result) {
229232
if (err) {

0 commit comments

Comments
 (0)