Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Manager.prototype.onopen = function() {
this.cleanup()
this.readyState = 'open'
this.emit('open')
const socket = this.engine
this.subs.push(on(socket, 'data', bind(this, 'ondata')))
this.subs.push(on(socket, 'ping', bind(this, 'onping')))
this.subs.push(on(socket, 'pong', bind(this, 'onpong')))
this.subs.push(on(socket, 'error', bind(this, 'onerror')))
this.subs.push(on(socket, 'close', bind(this, 'onclose')))
// this.subs.push(on(this.decoder, 'decoded', bind(this, 'ondecoded')))
}
Manager.prototype.onopen = function() {
this.cleanup()
this.readyState = 'open'
this.emit('open')
const socket = this.engine
this.subs.push(on(socket, 'data', bind(this, 'ondata')))
this.subs.push(on(socket, 'ping', bind(this, 'onping')))
this.subs.push(on(socket, 'pong', bind(this, 'onpong')))
this.subs.push(on(socket, 'error', bind(this, 'onerror')))
this.subs.push(on(socket, 'close', bind(this, 'onclose')))
// this.subs.push(on(this.decoder, 'decoded', bind(this, 'ondecoded')))
}
Manager.prototype.onopen = function() {
this.cleanup()
this.readyState = 'open'
this.emit('open')
const socket = this.engine
this.subs.push(on(socket, 'data', bind(this, 'ondata')))
this.subs.push(on(socket, 'ping', bind(this, 'onping')))
this.subs.push(on(socket, 'pong', bind(this, 'onpong')))
this.subs.push(on(socket, 'error', bind(this, 'onerror')))
this.subs.push(on(socket, 'close', bind(this, 'onclose')))
// this.subs.push(on(this.decoder, 'decoded', bind(this, 'ondecoded')))
}
Manager.prototype.onopen = function() {
this.cleanup()
this.readyState = 'open'
this.emit('open')
const socket = this.engine
this.subs.push(on(socket, 'data', bind(this, 'ondata')))
this.subs.push(on(socket, 'ping', bind(this, 'onping')))
this.subs.push(on(socket, 'pong', bind(this, 'onpong')))
this.subs.push(on(socket, 'error', bind(this, 'onerror')))
this.subs.push(on(socket, 'close', bind(this, 'onclose')))
// this.subs.push(on(this.decoder, 'decoded', bind(this, 'ondecoded')))
}
Socket.prototype.subEvents = function() {
if (this.subs) return
const io = this.io
this.subs = [
on(io, 'open', bind(this, 'onopen')),
on(io, 'packet', bind(this, 'onpacket')),
on(io, 'close', bind(this, 'onclose')),
]
}
Engine.prototype.bindEvents = function() {
this.subs.push(on(GlobalEmitter, 'open', bind(this, 'onopen')))
this.subs.push(on(GlobalEmitter, 'close', bind(this, 'onclose')))
this.subs.push(on(GlobalEmitter, 'error', bind(this, 'onerror')))
this.subs.push(on(GlobalEmitter, 'packet', bind(this, 'onpacket')))
}
Socket.prototype.subEvents = function() {
if (this.subs) return
const io = this.io
this.subs = [
on(io, 'open', bind(this, 'onopen')),
on(io, 'packet', bind(this, 'onpacket')),
on(io, 'close', bind(this, 'onclose')),
]
}
Engine.prototype.bindEvents = function() {
this.subs.push(on(GlobalEmitter, 'open', bind(this, 'onopen')))
this.subs.push(on(GlobalEmitter, 'close', bind(this, 'onclose')))
this.subs.push(on(GlobalEmitter, 'error', bind(this, 'onerror')))
this.subs.push(on(GlobalEmitter, 'packet', bind(this, 'onpacket')))
}
Socket.prototype.subEvents = function() {
if (this.subs) return
const io = this.io
this.subs = [
on(io, 'open', bind(this, 'onopen')),
on(io, 'packet', bind(this, 'onpacket')),
on(io, 'close', bind(this, 'onclose')),
]
}
Engine.prototype.bindEvents = function() {
this.subs.push(on(GlobalEmitter, 'open', bind(this, 'onopen')))
this.subs.push(on(GlobalEmitter, 'close', bind(this, 'onclose')))
this.subs.push(on(GlobalEmitter, 'error', bind(this, 'onerror')))
this.subs.push(on(GlobalEmitter, 'packet', bind(this, 'onpacket')))
}