Example #1
0
 }, function (ignoreErr, session, user) {
   if (!user) {
     conn.connack({
       // Connection Refused, not authorized
       returnCode: 0x05
     })
     // send an appropriate CONNACK response with a non-zero return code as described in section 3.2 and it MUST close the Network Connection [MQTT-3.1.4]
     conn.end()
   } else {
     socketService.startListening(serverEmitter, sessionId, session, user)
     conn.connack({
       returnCode: 0,
       sessionPresent: false
     })
   }
 })
Example #2
0
 socketService.onConnect(sessionId, authToken, serverEmitter, function () {
   conn.end()
 }, function (ignoreErr, session, user) {