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

elws

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elws - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

2

package.json
{
"name": "elws",
"version": "1.0.2",
"version": "1.0.3",
"description": "Simple auto-reconnect WebSocket decorator",

@@ -5,0 +5,0 @@ "main": "rws.js",

@@ -13,6 +13,7 @@ var WebSocket = require('ws');

this.url = this.urls[this.urlIndex];
this.times = 1;
this.force = false;
}
RWebSocket.prototype = {
times:1,//retry count
connect: function () {

@@ -45,3 +46,3 @@ var self = this;

// abnormal close
if (!connectTimeout) {
if ((!connectTimeout)&&(!self.force) ){
connectTimeout = setTimeout(function () {

@@ -71,3 +72,3 @@ if(self.times > self.retryMaxTimes)

case 'ECONNREFUSED':
if (!connectTimeout) {
if ((!connectTimeout)&&(!self.force) ) {
connectTimeout = setTimeout(function () {

@@ -83,3 +84,3 @@ if(self.times > self.retryMaxTimes)

}
//console.log("time out #"+self.times);
// console.log("time out #"+self.times);
self.connect();

@@ -99,2 +100,3 @@ self.times++;

this.client.stopTimeout = function(){
self.force = true;
clearTimeout(connectTimeout);

@@ -101,0 +103,0 @@ connectTimeout = null;

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