connection timeout to ms
This commit is contained in:
parent
7dbcc4f863
commit
56e1905bb3
@ -262,6 +262,8 @@ var StratumServer = exports.Server = function StratumServer(ports, connectionTim
|
|||||||
|
|
||||||
//private members
|
//private members
|
||||||
|
|
||||||
|
var connectionTimeoutSeconds = connectionTimeout * 1000;
|
||||||
|
|
||||||
var _this = this;
|
var _this = this;
|
||||||
var stratumClients = {};
|
var stratumClients = {};
|
||||||
var subscriptionCounter = SubscriptionCounter();
|
var subscriptionCounter = SubscriptionCounter();
|
||||||
@ -306,7 +308,7 @@ var StratumServer = exports.Server = function StratumServer(ports, connectionTim
|
|||||||
// 'm not sure if that can ever happn but an if here doesn't hurt!
|
// 'm not sure if that can ever happn but an if here doesn't hurt!
|
||||||
var client = stratumClients[clientId];
|
var client = stratumClients[clientId];
|
||||||
if (typeof(client) !== 'undefined') {
|
if (typeof(client) !== 'undefined') {
|
||||||
if (Date.now() - client.lastActivity > connectionTimeout){
|
if (Date.now() - client.lastActivity > connectionTimeoutSeconds){
|
||||||
client.socket.end();
|
client.socket.end();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user