mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-18 02:13:00 +08:00
Removed 3rd-Party libraries.
This commit is contained in:
@@ -4,8 +4,6 @@ using MQTTnet.Core;
|
||||
using MQTTnet.Core.Client;
|
||||
using MQTTnet.Core.ManagedClient;
|
||||
using MQTTnet.Core.Protocol;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.IO;
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
@@ -16,14 +14,6 @@ namespace MQTTnet.TestApp.NetCore
|
||||
{
|
||||
public static async Task RunAsync()
|
||||
{
|
||||
var services = new ServiceCollection()
|
||||
.AddMqttClient()
|
||||
.AddLogging()
|
||||
.BuildServiceProvider();
|
||||
|
||||
services.GetService<ILoggerFactory>()
|
||||
.AddConsole();
|
||||
|
||||
var ms = new ClientRetainedMessageHandler();
|
||||
|
||||
var options = new ManagedMqttClientOptions
|
||||
@@ -44,7 +34,7 @@ namespace MQTTnet.TestApp.NetCore
|
||||
|
||||
try
|
||||
{
|
||||
var managedClient = services.GetRequiredService<ManagedMqttClient>();
|
||||
var managedClient = new MqttFactory().CreateManagedMqttClient();
|
||||
managedClient.ApplicationMessageReceived += (s, e) =>
|
||||
{
|
||||
Console.WriteLine(">> RECEIVED: " + e.ApplicationMessage.Topic);
|
||||
|
||||
Reference in New Issue
Block a user