mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-15 00:15:15 +08:00
Update documents
This commit is contained in:
@@ -13,9 +13,13 @@
|
||||
<releaseNotes>* [Client] Added support for web socket communication channel (thanks to nowakpiotr)
|
||||
* [Core] Huge performance optimizations (thanks to JanEggers)
|
||||
* [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>
|
||||
<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>
|
||||
|
||||
<group targetFramework="netstandard1.3">
|
||||
@@ -24,7 +28,7 @@
|
||||
</group>
|
||||
|
||||
<group targetFramework="uap10.0">
|
||||
<dependency id="Microsoft.NETCore.UniversalWindowsPlatform" version="5.3.3" />
|
||||
<dependency id="Microsoft.NETCore.UniversalWindowsPlatform" version="5.4.0" />
|
||||
</group>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -80,14 +80,12 @@ client.ApplicationMessageReceived += (s, e) =>
|
||||
|
||||
client.Connected += async (s, e) =>
|
||||
{
|
||||
Console.WriteLine("### CONNECTED WITH SERVER ###");
|
||||
Console.WriteLine("### CONNECTED WITH SERVER, SUBSCRIBING ###");
|
||||
|
||||
await client.SubscribeAsync(new List<TopicFilter>
|
||||
{
|
||||
new TopicFilter("#", MqttQualityOfServiceLevel.AtMostOnce)
|
||||
});
|
||||
|
||||
Console.WriteLine("### SUBSCRIBED ###");
|
||||
};
|
||||
|
||||
client.Disconnected += async (s, e) =>
|
||||
@@ -116,17 +114,12 @@ catch
|
||||
|
||||
Console.WriteLine("### WAITING FOR APPLICATION MESSAGES ###");
|
||||
|
||||
var messageFactory = new MqttApplicationMessageFactory();
|
||||
while (true)
|
||||
{
|
||||
Console.ReadLine();
|
||||
|
||||
var applicationMessage = new MqttApplicationMessage(
|
||||
"A/B/C",
|
||||
Encoding.UTF8.GetBytes("Hello World"),
|
||||
MqttQualityOfServiceLevel.AtLeastOnce,
|
||||
false
|
||||
);
|
||||
|
||||
var applicationMessage = messageFactory.CreateApplicationMessage("myTopic", "Hello World", MqttQualityOfServiceLevel.AtLeastOnce);
|
||||
await client.PublishAsync(applicationMessage);
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user