Refactor web socket usage

This commit is contained in:
Christian Kratky
2017-09-18 18:20:36 +02:00
parent b5fc6e3d12
commit 32473af7c2
24 changed files with 116 additions and 86 deletions
@@ -113,16 +113,16 @@ namespace MQTTnet.TestApp.NetFramework
.Select(i => CreateMessage())
.ToList();
if (false)
{
//send concurrent (test for raceconditions)
var sendTasks = msgs
.Select(msg => PublishSingleMessage(client, msg, ref msgCount))
.ToList();
////if (false)
////{
//// //send concurrent (test for raceconditions)
//// var sendTasks = msgs
//// .Select(msg => PublishSingleMessage(client, msg, ref msgCount))
//// .ToList();
await Task.WhenAll(sendTasks);
}
else
//// await Task.WhenAll(sendTasks);
////}
////else
{
await client.PublishAsync(msgs);
msgCount += msgs.Count;