Browse Source

gently close the connection before leaving the page

release/3.x.x
Jan Eggers 7 years ago
parent
commit
0e0fcabc04
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      Tests/MQTTnet.TestApp.AspNetCore2/wwwroot/app/app.ts

+ 5
- 1
Tests/MQTTnet.TestApp.AspNetCore2/wwwroot/app/app.ts View File

@@ -13,4 +13,8 @@ client.on('connect', () => {
client.on('message', (topic, message) => {
// message is Buffer
console.log(message.toString());
})
});

window.onbeforeunload = () => {
client.end();
};

Loading…
Cancel
Save