You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After calling end you should recreate a new instance, end it's like destroy, it removes some listeners and other stuff that make the instance not usable anymore
After calling end you should recreate a new instance, end it's like destroy, it removes some listeners and other stuff that make the instance not usable anymore
Yes, I have modified it. It always feels strange. Perhaps it is not semantic enough? Like new connect()?
Problem description:
It disconnects correctly the first time.
When I connect a second time, do end again and it doesn't disconnect.
Use version:
latest version
expect:
It can disconnect correctly
fragment:
`
const sleep = (ms) => new Promise(res => setTimeout(res, ms));
const a = mqtt.connect('mqtt://127.0.0.1:49800', { username: 'test', password: 'test',manualConnect:true})
a.connect()
await sleep(5000)
a.end() //It disconnects correctly
await sleep(3000)
a.connect() //It connects correctly
await sleep(1000)
a.end() // It does not disconnect correctly
`
The text was updated successfully, but these errors were encountered: