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

sy_node_rpc

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

sy_node_rpc - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

.idea/dictionaries/admin.xml

36

json_socket/client_socket.js

@@ -21,2 +21,3 @@ const BaseSocket = require('./base_socket');

this.client = null;
this.options = options;

@@ -41,5 +42,35 @@ if (options.socket) {

this.client.on('error', this._errorHandler.bind(this));
this.client.on('timeout', this._timeoutHandler.bind(this));
}
reconnect() {
if (this.closed) {
throw Error('socket already destroyed');
}
if (!this.client.destroyed) {
throw Error('socket is connecting');
}
if (this.options.socket) {
throw Error('only client can be reconnected');
}
if (!this.options.host || !this.options.port) {
throw Error('invalid options');
}
this.client = new net.Socket();
this.client.connect({
host: this.options.host,
port: this.options.port
});
this.remoteAddress = this.client.remoteAddress;
this.client.on('connect', this._connectHandler.bind(this));
this.client.on('close', this._closeHandler.bind(this));
this.client.on('data', this._dataHandler.bind(this));
this.client.on('error', this._errorHandler.bind(this));
this.client.on('timeout', this._timeoutHandler.bind(this));
}
/**

@@ -200,2 +231,7 @@ * 发起rpc 请求

};
_timeoutHandler() {
this.emit('timeout');
}
}

@@ -202,0 +238,0 @@

4

package.json
{
"name": "sy_node_rpc",
"version": "0.0.2",
"version": "0.0.3",
"engines": {
"node": ">=8.0.0"
"node": ">=7.6"
},

@@ -7,0 +7,0 @@ "private": false,

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