File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -231,7 +231,7 @@ MQTT.prototype.packetHandler = function(data) {
231
231
//console.log("Unsubscription succesful.");
232
232
this . emit ( 'unsubscribed' ) ;
233
233
} else if ( type === TYPE . PINGREQ ) {
234
- this . client . write ( fromCharCode ( TYPE . PINGRESP << 4 ) + "\x00" ) ;
234
+ this . client . write ( fromCharCode ( TYPE . PINGRESP << 4 , 0 ) ) ;
235
235
} else if ( type === TYPE . PINGRESP ) {
236
236
this . emit ( 'ping_reply' ) ;
237
237
} else if ( type === TYPE . CONNACK ) {
@@ -317,7 +317,7 @@ MQTT.prototype._scktClosed = function () {
317
317
MQTT . prototype . disconnect = function ( ) {
318
318
if ( ! this . client ) return ;
319
319
try {
320
- this . client . write ( fromCharCode ( TYPE . DISCONNECT << 4 ) + "\x00" ) ;
320
+ this . client . write ( fromCharCode ( TYPE . DISCONNECT << 4 , 0 ) ) ;
321
321
} catch ( e ) {
322
322
return this . _scktClosed ( ) ;
323
323
}
@@ -383,7 +383,7 @@ MQTT.prototype.unsubscribe = function (topic) {
383
383
MQTT . prototype . ping = function ( ) {
384
384
if ( ! this . client ) return ;
385
385
try {
386
- this . client . write ( fromCharCode ( TYPE . PINGREQ << 4 ) + "\x00" ) ;
386
+ this . client . write ( fromCharCode ( TYPE . PINGREQ << 4 , 0 ) ) ;
387
387
} catch ( e ) {
388
388
this . _scktClosed ( ) ;
389
389
}
You can’t perform that action at this time.
0 commit comments