Add more function mappings for MQTTnet Server.

This commit is contained in:
Christian Kratky
2019-03-06 22:42:00 +01:00
parent dffc27c1f4
commit 8708609498
55 changed files with 664 additions and 363 deletions
@@ -4,6 +4,7 @@ using System.IO;
using Newtonsoft.Json;
using System.Collections.Generic;
using MQTTnet.Client.Options;
using MQTTnet.Client.Receiving;
using MQTTnet.Extensions.ManagedClient;
using MQTTnet.Protocol;
@@ -34,10 +35,10 @@ namespace MQTTnet.TestApp.NetCore
try
{
var managedClient = new MqttFactory().CreateManagedMqttClient();
managedClient.ApplicationMessageReceived += (s, e) =>
managedClient.ApplicationMessageReceivedHandler = new MqttApplicationMessageHandlerDelegate(e =>
{
Console.WriteLine(">> RECEIVED: " + e.ApplicationMessage.Topic);
};
});
await managedClient.PublishAsync(builder => builder.WithTopic("Step").WithPayload("1"));
await managedClient.PublishAsync(builder => builder.WithTopic("Step").WithPayload("2").WithAtLeastOnceQoS());