1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
server.on('clientConnected', function (client) { console.log('client connected', client.id) })
server.on('clientDisconnecting', function (client) { console.log('client client disconnecting', client.id) })
server.on('clientDisconnected', function (client) { console.log('client is disconnected', client.id) })
server.on('clientError', function (client) { console.log('client identifies error', client.id) })
server.on('published', function (packet, client) { console.log('Published Topic', packet.topic) console.log('Published Payload', packet.payload.toString()) })
server.on('subscribed', async (topic) => { let ret = await moscaHandle(topic, 100) console.log('Subscribed', topic, ret) })
server.on('unsubscribed', function (topic) { console.log('Ubsubscribed', topic) })
server.on('ready', function () { console.log('server is running') })
|