[BF] When using Dispose, kill also mqtt connection
This commit is contained in:
parent
1b0fb91b08
commit
03849c999a
@ -28,7 +28,7 @@ namespace BlubbFish.Utils.IoT.Bots {
|
||||
this.httplistener = new HttpListener();
|
||||
this.httplistener.Prefixes.Add(this.config["prefix"]);
|
||||
this.httplistener.Start();
|
||||
ThreadPool.QueueUserWorkItem((o) => {
|
||||
_ = ThreadPool.QueueUserWorkItem((o) => {
|
||||
Console.WriteLine("Webserver is Running...");
|
||||
try {
|
||||
while(this.httplistener.IsListening) {
|
||||
@ -147,6 +147,9 @@ namespace BlubbFish.Utils.IoT.Bots {
|
||||
public override void Dispose() {
|
||||
this.httplistener.Stop();
|
||||
this.httplistener.Close();
|
||||
if(this.databackend != null) {
|
||||
this.databackend.Dispose();
|
||||
}
|
||||
base.Dispose();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user