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

zerorpc

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zerorpc - npm Package Compare versions

Comparing version 0.6.0 to 0.6.1

example_server.js

47

lib/channel.js

@@ -137,3 +137,4 @@ // Open Source Initiative OSI - The MIT License (MIT):Licensing

while(this._outBuffer.length() > 0 && this._outBuffer.hasCapacity()) {
this._sendImmediately(this._outBuffer.remove());
this._socket.send(this._outBuffer.remove());
this._outBuffer.decrementCapacity();
}

@@ -148,28 +149,2 @@

//Creates a header for an event
Channel.prototype._createHeader = function() {
return { v: PROTOCOL_VERSION, message_id: uuid.v4(), response_to: this.id };
};
//Immediately sends a messages
Channel.prototype._sendImmediately = function(event) {
//console.log("SEND", event);
this._socket.send(event);
this._outBuffer.decrementCapacity();
};
//Sends a _zpc_more event
Channel.prototype._sendMore = function() {
var capacity = this._inBuffer.getCapacity();
var event = events.create(this._envelope, this._createHeader(), "_zpc_more", [capacity]);
this._sendImmediately(event);
};
//Updates the capacity and sends a _zpc_more event
Channel.prototype._resetCapacity = function() {
var newCapacity = this._capacity - this._inBuffer.length();
this._inBuffer.setCapacity(newCapacity);
this._sendMore();
};
//Sends a message

@@ -190,3 +165,4 @@ //name : String

if(this._outBuffer.hasCapacity()) {
this._sendImmediately(event);
this._socket.send(event);
this._outBuffer.decrementCapacity();
} else {

@@ -199,6 +175,19 @@ //console.log("QUEUE", event);

this._fresh = false;
this._sendMore();
this._resetCapacity();
}
};
//Creates a header for an event
Channel.prototype._createHeader = function() {
return { v: PROTOCOL_VERSION, message_id: uuid.v4(), response_to: this.id };
};
//Updates the capacity and sends a _zpc_more event
Channel.prototype._resetCapacity = function() {
var newCapacity = this._capacity - this._inBuffer.length();
this._inBuffer.setCapacity(newCapacity);
var event = events.create(this._envelope, this._createHeader(), "_zpc_more", [newCapacity]);
this._socket.send(event);
};
//Creates a new server-side channel

@@ -205,0 +194,0 @@ //srcEvent : Object

{
"name": "zerorpc",
"version": "0.6.0",
"version": "0.6.1",
"main": "./index.js",

@@ -5,0 +5,0 @@ "author": "dotCloud <opensource@dotcloud.com>",

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