Skip to content

Instantly share code, notes, and snippets.

@mgwedd
Created July 24, 2019 15:05
Show Gist options
  • Save mgwedd/12d0bb571c7042fa1873f8b1ad61286f to your computer and use it in GitHub Desktop.
Save mgwedd/12d0bb571c7042fa1873f8b1ad61286f to your computer and use it in GitHub Desktop.
// C# .Net
client.UseApplicationMessageReceivedHandler(e =>
{
Console.WriteLine("### RECEIVED APPLICATION MESSAGE ###");
Console.WriteLine($"+ Topic = {e.ApplicationMessage.Topic}");
Console.WriteLine($"+ Payload = {Encoding.UTF8.GetString(e.ApplicationMessage.Payload)}");
Console.WriteLine($"+ QoS = {e.ApplicationMessage.QualityOfServiceLevel}");
Console.WriteLine($"+ Retain = {e.ApplicationMessage.Retain}");
Console.WriteLine();
Task.Run(() => client.PublishAsync("hello/world"));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment