Skip to content

Commit

Permalink
Merge 9be3209 into 81e75ac
Browse files Browse the repository at this point in the history
  • Loading branch information
gnought committed Sep 2, 2019
2 parents 81e75ac + 9be3209 commit 816aa40
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -107,7 +107,7 @@ Options:
* `connectTimeout`: the max number of milliseconds to wait for the CONNECT
packet to arrive, defaults to `30000` milliseconds
* `id`: id used to identify this broker instance in `$SYS` messages,
defaults to `shortid()`
defaults to `uuidv5()`
* `preConnect`: function called when a valid CONNECT is received, see
[instance.preConnect()](#preConnect)
* `authenticate`: function used to authenticate clients, see
Expand Down Expand Up @@ -376,7 +376,7 @@ Events:
<a name="clientid"></a>
### client#id
The id of the client, as specified by the CONNECT packet.
The id of the client, as specified by the CONNECT packet, defaults to 'aedes_' + shortid()
-------------------------------------------------------
<a name="clientclean"></a>
Expand Down
8 changes: 4 additions & 4 deletions aedes.js
Expand Up @@ -6,7 +6,7 @@ var util = require('util')
var memory = require('aedes-persistence')
var parallel = require('fastparallel')
var series = require('fastseries')
var shortid = require('shortid')
var uuidv5 = require('uuid/v5')
var Packet = require('aedes-packet')
var bulk = require('bulk-write-stream')
var reusify = require('reusify')
Expand Down Expand Up @@ -36,12 +36,13 @@ function Aedes (opts) {

opts = Object.assign({}, defaultOptions, opts)

this.id = opts.id || shortid()
this.id = opts.id || uuidv5('https://github.com/mcollina/aedes', uuidv5.URL)
this.counter = 0
this.connectTimeout = opts.connectTimeout
this.mq = opts.mq || mqemitter(opts)
this.handle = function handle (conn) {
conn.setMaxListeners(opts.concurrency * 2)
// create a new Client instance for a new connection
// return, just to please standard
return new Client(that, conn)
}
Expand Down Expand Up @@ -244,8 +245,7 @@ Aedes.prototype.unsubscribe = function (topic, func, done) {
Aedes.prototype.registerClient = function (client) {
var that = this
if (this.clients[client.id]) {
// moving out so we wait for this, so we don't
// unregister a good client
// [MQTT-3.1.4-2]
this.clients[client.id].close(function closeClient () {
that._finishRegisterClient(client)
})
Expand Down

0 comments on commit 816aa40

Please sign in to comment.