Skip to content

Instantly share code, notes, and snippets.

@mgwedd
Created July 24, 2019 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgwedd/cb36191fce7e3588de4326779a852e47 to your computer and use it in GitHub Desktop.
Save mgwedd/cb36191fce7e3588de4326779a852e47 to your computer and use it in GitHub Desktop.
// C# .Net
var message = new MqttApplicationMessageBuilder()
.WithTopic("MyTopic")
.WithPayload("Hello World")
.WithExactlyOnceQoS()
.WithRetainFlag()
.Build();
await client.PublishAsync(message);
//Check out the MQTTnet docs and wiki for more examples.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment