Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

connection-manager

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

connection-manager - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

29

lib/manager.js

@@ -34,12 +34,19 @@ /**

var reconnecting = false;
var self = this;
if (! reportingActive) {
reportingActive = true;
setInterval(function _report() {
setInterval(function __report() {
self.clients.forEachRecord(function (client) {
var count = client.references.getCount();
if ((count > 0) && (! client.isConnected())) {
if ((count > 0) && ((typeof client.isConnected !== 'function') || (! client.isConnected())) && (! reconnecting)) {
debug('client ' + client.id + ' is disconnected, but reference count: ' + count + ', reconnecting...');
var scopes = client.references.getIdentifiers();
var scope = client.references.getRecord(scopes[0]);
var scopes = client.references.getIdentifiers();
var scope = client.references.getRecord(scopes[0]);
reconnecting = true;
client.connect.call(buildScope(scope, client), function (err, c) {

@@ -53,2 +60,3 @@ if (err) {

client = registerListeners(scope, client);
reconnecting = false;
});

@@ -61,3 +69,3 @@

});
}, 30000);
}, 60000);
}

@@ -251,3 +259,3 @@ }

o.timeout = (typeof o.timeout === 'number') ? o.timeout : 6000;
o.timeout = (typeof o.timeout === 'number') ? o.timeout : 10000;

@@ -374,3 +382,3 @@ var client = {

debug('removing reference ' + id);
debug('removing reference ' + id + ' scope_id: ' + scope.id);
// first thing is we decrese the count by removing the session

@@ -454,2 +462,3 @@ client.references.removeRecord(scope.id);

var removeListener = client.removeListener;
var isConnected = client.isConnected;
var disconnect = client.disconnect;

@@ -465,2 +474,3 @@

removeListener: removeListener,
isConnected: isConnected,
disconnect: disconnect,

@@ -522,5 +532,5 @@ };

/**
* Function: getIDs
* Function: getKeys
*
* returns all IDs existing within the namespace
* returns all keys existing within the namespace
*

@@ -539,2 +549,3 @@ * Parameters:

module.exports = ConnectionManager;
{
"name": "connection-manager",
"version": "0.1.5",
"version": "0.1.6",
"description": "Store, checkout & keepalive active connections from multiple locations in your code-base.",

@@ -5,0 +5,0 @@ "main": "./index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc