base-node.js
function destroy () {
    if (this.connection.destroy) {
      this.connection.destroy()
    } else if (this.connected) {
      this.connection.disconnect('destroy')
    }
    for (var i = 0; i < this.unbind.length; i++) {
      this.unbind[i]()
    }
    clearTimeout(this.pingTimeout)
    this.endTimeout()
  }
function destroy () {
    if (this.connection.destroy) {
      this.connection.destroy()
    } else if (this.connected) {
      this.connection.disconnect('destroy')
    }
    for (var i = 0; i < this.unbind.length; i++) {
      this.unbind[i]()
    }
    clearTimeout(this.pingTimeout)
    this.endTimeout()
  }
function destroy ( ) { if ( this . connection . destroy ) { this . connection . destroy ( ) } else if ( this . connected ) { this . connection . disconnect ( 'destroy' ) } for ( var i = 0 ; i < this . unbind . length ; i ++ ) { this . unbind [ i ] ( ) } clearTimeout ( this . pingTimeout ) this . endTimeout ( ) }
Shut down the connection and unsubscribe from log events.

@return {undefined}

@example
connection.on('disconnect', () => {
server.destroy()
})
Shut down the connection and unsubscribe from log events .