mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-16 17:23:04 +08:00
37 lines
991 B
C#
37 lines
991 B
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; }
|
|
|
|
bool IsReadingPacket { get; }
|
|
|
|
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();
|
|
}
|
|
}
|