Update documents

This commit is contained in:
Christian Kratky
2017-09-19 23:07:42 +02:00
parent 83f1d74a76
commit 493c934463
2 changed files with 9 additions and 12 deletions
+6 -2
View File
@@ -13,9 +13,13 @@
<releaseNotes>* [Client] Added support for web socket communication channel (thanks to nowakpiotr) <releaseNotes>* [Client] Added support for web socket communication channel (thanks to nowakpiotr)
* [Core] Huge performance optimizations (thanks to JanEggers) * [Core] Huge performance optimizations (thanks to JanEggers)
* [Client] Fixed an issue when calling _DisconnectAsync_ and the connection is already closed. * [Client] Fixed an issue when calling _DisconnectAsync_ and the connection is already closed.
* [Core] Added several new interfaces
* [Core] Added a factory for creation of application messages
* [Core] Fixed issues in connection handling
* [Client] Fixed issues with subscribing/unsubscribing (breaking change!)
</releaseNotes> </releaseNotes>
<copyright>Copyright Christian Kratky 2016-2017</copyright> <copyright>Copyright Christian Kratky 2016-2017</copyright>
<tags>MQTT MQTTClient MQTTServer MQTTBroker Broker NETStandard IoT InternetOfThings Messaging Queue Hardware Arduino</tags> <tags>MQTT Message Queue Telemetry Transport MQTTClient MQTTServer Server MQTTBroker Broker NETStandard IoT InternetOfThings Messaging Hardware Arduino Sensor Actuator M2M</tags>
<dependencies> <dependencies>
<group targetFramework="netstandard1.3"> <group targetFramework="netstandard1.3">
@@ -24,7 +28,7 @@
</group> </group>
<group targetFramework="uap10.0"> <group targetFramework="uap10.0">
<dependency id="Microsoft.NETCore.UniversalWindowsPlatform" version="5.3.3" /> <dependency id="Microsoft.NETCore.UniversalWindowsPlatform" version="5.4.0" />
</group> </group>
</dependencies> </dependencies>
+3 -10
View File
@@ -80,14 +80,12 @@ client.ApplicationMessageReceived += (s, e) =>
client.Connected += async (s, e) => client.Connected += async (s, e) =>
{ {
Console.WriteLine("### CONNECTED WITH SERVER ###"); Console.WriteLine("### CONNECTED WITH SERVER, SUBSCRIBING ###");
await client.SubscribeAsync(new List<TopicFilter> await client.SubscribeAsync(new List<TopicFilter>
{ {
new TopicFilter("#", MqttQualityOfServiceLevel.AtMostOnce) new TopicFilter("#", MqttQualityOfServiceLevel.AtMostOnce)
}); });
Console.WriteLine("### SUBSCRIBED ###");
}; };
client.Disconnected += async (s, e) => client.Disconnected += async (s, e) =>
@@ -116,17 +114,12 @@ catch
Console.WriteLine("### WAITING FOR APPLICATION MESSAGES ###"); Console.WriteLine("### WAITING FOR APPLICATION MESSAGES ###");
var messageFactory = new MqttApplicationMessageFactory();
while (true) while (true)
{ {
Console.ReadLine(); Console.ReadLine();
var applicationMessage = new MqttApplicationMessage( var applicationMessage = messageFactory.CreateApplicationMessage("myTopic", "Hello World", MqttQualityOfServiceLevel.AtLeastOnce);
"A/B/C",
Encoding.UTF8.GetBytes("Hello World"),
MqttQualityOfServiceLevel.AtLeastOnce,
false
);
await client.PublishAsync(applicationMessage); await client.PublishAsync(applicationMessage);
} }
``` ```