mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-17 17:53:03 +08:00
39 lines
1.0 KiB
C#
39 lines
1.0 KiB
C#
using System;
|
|
using System.Security.Cryptography.X509Certificates;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using MQTTnet.Formatter;
|
|
using MQTTnet.Packets;
|
|
|
|
namespace MQTTnet.Adapter
|
|
{
|
|
public interface IMqttChannelAdapter : IDisposable
|
|
{
|
|
string Endpoint { get; }
|
|
|
|
bool IsSecureConnection { get; }
|
|
|
|
X509Certificate2 ClientCertificate { get; }
|
|
|
|
MqttPacketFormatterAdapter PacketFormatterAdapter { get; }
|
|
|
|
long BytesSent { get; }
|
|
|
|
long BytesReceived { get; }
|
|
|
|
Action ReadingPacketStartedCallback { get; set; }
|
|
|
|
Action ReadingPacketCompletedCallback { get; set; }
|
|
|
|
Task ConnectAsync(TimeSpan timeout, CancellationToken cancellationToken);
|
|
|
|
Task DisconnectAsync(TimeSpan timeout, CancellationToken cancellationToken);
|
|
|
|
Task SendPacketAsync(MqttBasePacket packet, TimeSpan timeout, CancellationToken cancellationToken);
|
|
|
|
Task<MqttBasePacket> ReceivePacketAsync(TimeSpan timeout, CancellationToken cancellationToken);
|
|
|
|
void ResetStatistics();
|
|
}
|
|
}
|