rocket.chat.mqtt
Version:
It's a MQTT Server, using redis to scale horizontally.
32 lines (23 loc) • 535 B
JavaScript
var write = require('../write')
function PubRel (packet) {
this.cmd = 'pubrel'
this.messageId = packet.messageId
}
function handlePubrec (client, packet, done) {
var pubrel = new PubRel(packet)
if (client.clean) {
write(client, pubrel, done)
return
}
client.broker.persistence.outgoingUpdate(
client, pubrel, reply)
function reply (err) {
if (err) {
// TODO is this ok?
return client._onError(err)
}
write(client, pubrel, done)
}
}
module.exports = handlePubrec