fixed clients overlapping from one test to another by:

- adding client and server wrappers to verify the clientid starts with the testname
- adding disposable baseclass
- clear disconnect handler from client so it does not try to reconnect after it is disposed
- moved code from dispose to cleanup in case it is called in a stop method as dispose may only be called once while start / stop may be called multiple times
This commit is contained in:
JanEggers
2019-12-20 15:37:23 +01:00
parent 624fafc662
commit 14419e4d63
22 changed files with 486 additions and 170 deletions
+7 -3
View File
@@ -4,7 +4,7 @@ using System.Threading;
namespace MQTTnet.Internal
{
public class BlockingQueue<TItem> : IDisposable
public class BlockingQueue<TItem> : Disposable
{
private readonly object _syncRoot = new object();
private readonly LinkedList<TItem> _items = new LinkedList<TItem>();
@@ -109,9 +109,13 @@ namespace MQTTnet.Internal
}
}
public void Dispose()
protected override void Dispose(bool disposing)
{
_gate.Dispose();
if (disposing)
{
_gate.Dispose();
}
base.Dispose(disposing);
}
}
}