src/global-client.js
function init(options) {
  options = options || {}
  var port = options.port || 6466
  global.client = global.client || socketIOClient(`http://localhost:${port}`)
  client = global.client
  log.debug(`Started global js socketIO client for ${process.env.ADAPTER} at ${port}`)
  client.emit('join', ioid) // first join for serialization
  client.on('disconnect', client.disconnect)
  client.on('take', hasher.handle) // add listener
  
  // add methods
  client.pass = pass
  client.clientPass = clientPass
  return client
}
function init(options) {
  options = options || {}
  var port = options.port || 6466
  global.client = global.client || socketIOClient(`http://localhost:${port}`)
  client = global.client
  log.debug(`Started global js socketIO client for ${process.env.ADAPTER} at ${port}`)
  client.emit('join', ioid) // first join for serialization
  client.on('disconnect', client.disconnect)
  client.on('take', hasher.handle) // add listener
  
  // add methods
  client.pass = pass
  client.clientPass = clientPass
  return client
}
function init ( options ) { options = options || { } var port = options . port || 6466 global . client = global . client || socketIOClient ( ` ${ port } ` ) client = global . client log . debug ( ` ${ process . env . ADAPTER } ${ port } ` ) client . emit ( 'join' , ioid ) // first join for serialization client . on ( 'disconnect' , client . disconnect ) client . on ( 'take' , hasher . handle ) // add listener // add methods client . pass = pass client . clientPass = clientPass return client }
init a global client at port
init a global client at port