mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-16 17:23:04 +08:00
36 lines
1.0 KiB
C#
36 lines
1.0 KiB
C#
using System.Collections.Generic;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.Extensions.Hosting;
|
|
using Microsoft.Extensions.Logging;
|
|
using Microsoft.Extensions.Options;
|
|
using MQTTnet.Core.Adapter;
|
|
using MQTTnet.Core.Server;
|
|
|
|
namespace MQTTnet.AspNetCore
|
|
{
|
|
public class MqttHostedServer : MqttServer, IHostedService
|
|
{
|
|
public MqttHostedServer(
|
|
IOptions<MqttServerOptions> options,
|
|
IEnumerable<IMqttServerAdapter> adapters,
|
|
ILogger<MqttServer> logger,
|
|
MqttClientSessionsManager clientSessionsManager,
|
|
IMqttClientRetainedMessageManager clientRetainedMessageManager
|
|
)
|
|
: base(options, adapters, logger, clientSessionsManager, clientRetainedMessageManager)
|
|
{
|
|
}
|
|
|
|
public Task StartAsync(CancellationToken cancellationToken)
|
|
{
|
|
return StartAsync();
|
|
}
|
|
|
|
public Task StopAsync(CancellationToken cancellationToken)
|
|
{
|
|
return StopAsync();
|
|
}
|
|
}
|
|
}
|