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

nats

Package Overview
Dependencies
Maintainers
2
Versions
195
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nats - npm Package Compare versions

Comparing version 0.7.24 to 0.7.25

LICENSE

4

index.d.ts

@@ -64,3 +64,3 @@

encoding?: BufferEncoding,
tls?: boolean | tls.TlsOptions,
tls?: boolean | tls.TlsServerOptions,
name?: string,

@@ -154,2 +154,2 @@ yieldTime?: number,

constructor(message:string, code:string, chainedError?:Error);
}
}

@@ -24,3 +24,3 @@ /*!

*/
var VERSION = '0.7.24',
var VERSION = '0.7.25',

@@ -41,2 +41,6 @@ DEFAULT_PORT = 4222,

// Ping interval
DEFAULT_PING_INTERVAL = 2 * 60 * 1000, // 2 minutes
DEFAULT_MAX_PING_OUT = 2,
// Protocol

@@ -219,2 +223,4 @@ //CONTROL_LINE = /^(.*)\r\n/, // TODO: remove / never used

'waitOnFirstConnect': false,
'pingInterval': DEFAULT_PING_INTERVAL,
'maxPingOut': DEFAULT_MAX_PING_OUT,
};

@@ -258,2 +264,4 @@

this.assignOption(opts, 'preserveBuffers');
this.assignOption(opts, 'pingInterval');
this.assignOption(opts, 'maxPingOut');
}

@@ -393,2 +401,32 @@

Client.prototype.scheduleHeartbeat = function() {
this.pingTimer = setTimeout(function(client) {
client.emit('pingtimer');
if (client.closed) {
return;
}
// we could be waiting on the socket to connect
if (client.stream && !client.stream.connecting) {
client.emit('pingcount', client.pout);
client.pout++;
if (client.pout > client.options.maxPingOut) {
// processErr will scheduleReconnect
client.processErr(STALE_CONNECTION_ERR);
// don't reschedule, new connection initiated
return;
} else {
// send the ping
client.sendCommand(PING_REQUEST);
if (client.pongs) {
// no callback
client.pongs.push(undefined);
}
}
}
// reschedule
client.scheduleHeartbeat();
}, this.options.pingInterval, this);
};
/**

@@ -408,3 +446,8 @@ * Properly setup a stream event handlers.

stream.on('connect', function() {
if (client.pingTimer) {
clearTimeout(client.pingTimer);
delete client.pingTimer;
}
client.connected = true;
client.scheduleHeartbeat();
});

@@ -574,2 +617,3 @@

this.pending = [];
this.pout = 0;
};

@@ -607,2 +651,3 @@

this.pongs = null;
this.pout = 0;
this.pending = null;

@@ -791,2 +836,3 @@ this.pSize = 0;

} else if ((m = PONG.exec(buf)) !== null) {
client.pout = 0;
var cb = client.pongs && client.pongs.shift();

@@ -1011,3 +1057,4 @@ if (cb) {

if (m.indexOf(STALE_CONNECTION_ERR) !== -1) {
this.scheduleReconnect();
// closeStream() triggers a reconnect if allowed
this.closeStream();
} else if (m.indexOf(PERMISSIONS_ERR) !== -1) {

@@ -1014,0 +1061,0 @@ this.emit('permission_error', new NatsError(s, NATS_PROTOCOL_ERR));

{
"name": "nats",
"version": "0.7.24",
"version": "0.7.25",
"description": "Node.js client for NATS, a lightweight, high-performance cloud native messaging system",

@@ -5,0 +5,0 @@ "keywords": [

@@ -5,4 +5,7 @@ # NATS - Node.js Client

[![License MIT](https://img.shields.io/npm/l/express.svg)](http://opensource.org/licenses/MIT)
[![Build Status](https://travis-ci.org/nats-io/node-nats.svg?branch=master)](http://travis-ci.org/nats-io/node-nats) [![npm version](https://badge.fury.io/js/nats.svg)](http://badge.fury.io/js/nats)[![Coverage Status](https://coveralls.io/repos/github/nats-io/node-nats/badge.svg?branch=master)](https://coveralls.io/github/nats-io/node-nats?branch=master)
[![license](https://img.shields.io/github/license/nats-io/node-nats.svg)](http://opensource.org/licenses/MIT)
[![Travis branch](https://img.shields.io/travis/nats-io/node-nats/master.svg)]()
[![Coveralls github branch](https://img.shields.io/coveralls/github/nats-io/node-nats/master.svg)]()
[![npm](https://img.shields.io/npm/v/nats.svg)](https://www.npmjs.com/package/nats)
[![npm](https://img.shields.io/npm/dt/nats.svg)](https://www.npmjs.com/package/nats)

@@ -275,2 +278,3 @@ ## Installation

Copyright (c) 2018 Synadia Communications Inc.<br/>
Copyright (c) 2015-2017 Apcera Inc.<br/>

@@ -277,0 +281,0 @@ Copyright (c) 2011-2015 Derek Collison

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