New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

artnetjs

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

artnetjs - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

45

lib/controller.js

@@ -41,3 +41,2 @@ 'use strict';

this.socket = dgram.createSocket('udp4');

@@ -47,18 +46,50 @@ this.ShortName = 'Art-Net NodeJs';

this.nodes = {};
}
_initSocket() {
this.socket = dgram.createSocket('udp4');
this.socket.on('message', (msg, peer) => this._processMsg(msg, peer));
this.socket.on('error', e => console.log(e));
this.nodes = {};
}
start() {
this.socket.bind(PORT, () => {
async start(config) {
if(this.socket) {
await this.stop();
}
this._initSocket();
let readyPromise = new Promise(resolve => this.socket.once('listening', () => resolve()));
this.socket.bind({
port: PORT,
address: config.address
}, () => {
this.socket.setBroadcast(true);
});
setInterval(() => this._sendPoll(), 1000);
await readyPromise;
clearInterval(this._pollTimer);
this._pollTimer = setInterval(() => this._sendPoll(), 1000);
}
async stop() {
clearInterval(this._pollTimer);
if(this.socket) {
await new Promise(resolve => {
try {
this.socket.close(() => resolve());
} catch(e) {}
delete this.socket;
});
}
this.nodes = {};
this.emit('nodes', Object.keys(this.nodes).map(k => this.nodes[k]));
}
_processMsg(msg, peer) {

@@ -65,0 +96,0 @@

2

package.json

@@ -5,3 +5,3 @@ {

"author": "Christian Blaschke <mail@platdesign.de>",
"version": "0.0.7",
"version": "0.0.8",
"dependencies": {

@@ -8,0 +8,0 @@ "bipro": "0.0.8",

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