mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-16 09:13:02 +08:00
added some ui to send test msgs
This commit is contained in:
@@ -24,14 +24,14 @@ namespace MQTTnet.TestApp.AspNetCore2
|
||||
app.UseMqttServer(async server =>
|
||||
{
|
||||
var msg = new MqttApplicationMessageBuilder()
|
||||
.WithPayload("Mqtt is Awesome")
|
||||
.WithTopic("message")
|
||||
.Build();
|
||||
.WithPayload("Mqtt is awesome")
|
||||
.WithTopic("message");
|
||||
|
||||
while (true)
|
||||
{
|
||||
server.Publish(msg);
|
||||
server.Publish(msg.Build());
|
||||
await Task.Delay(TimeSpan.FromSeconds(2));
|
||||
msg.WithPayload("Mqtt is still awesome at " + DateTime.Now);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user