Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function Actor(stream) {
if (!(this instanceof Actor)) return new Actor(stream);
this.parser = new amp.Stream;
this.parser.on('data', this.onmessage.bind(this));
stream.pipe(this.parser);
this.stream = stream;
this.callbacks = {};
this.ids = 0;
this.id = ++ids;
Actor.emit('actor', this);
}
function Actor(stream) {
if (!(this instanceof Actor)) return new Actor(stream);
var that = this;
this.parser = new amp.Stream;
this.parser.on('data', this.onmessage.bind(this));
stream.pipe(this.parser);
this.stream = stream;
this.callbacks = {};
this.ids = 0;
this.id = ++ids;
this.secret_key = null;
Actor.emit('actor', this);
}
function Actor(stream) {
if (!(this instanceof Actor)) return new Actor(stream);
this.parser = new amp.Stream;
this.parser.on('data', this.onmessage.bind(this));
stream.pipe(this.parser);
this.stream = stream;
this.callbacks = {};
this.ids = 0;
this.id = ++ids;
Actor.emit('actor', this);
}
Socket.prototype.addSocket = function(sock){
var parser = new Parser;
var i = this.socks.push(sock) - 1;
debug('%s add socket %d', this.type, i);
sock.pipe(parser);
parser.on('data', this.onmessage(sock));
};