Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function sendPacket (client, packet, cb) {
client.emit('packetsend', packet)
var result = mqttPacket.writeToStream(packet, client.stream)
if (!result && cb) {
client.stream.once('drain', cb)
} else if (cb) {
cb()
}
}
function sendPacket (client, packet, cb) {
client.emit('packetsend', packet)
var result = mqttPacket.writeToStream(packet, client.stream, client.options)
if (!result && cb) {
client.stream.once('drain', cb)
} else if (cb) {
cb()
}
}
function write (chunk, enc, cb) {
if (writeToStream(chunk, output, that.opts)) {
cb()
} else {
output.once('drain', cb)
}
}