mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-26 08:02:59 +08:00
Added EndPoint RemoteEndPoint {get;} property to channel (#2111)
* Added EndPoint RemoteEndPoint{get;} property
* Reformat code
* Reformat code
---------
Co-authored-by: christian <6939810+chkr1011@users.noreply.github.com>
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Net;
|
||||
using System.Threading;
|
||||
using MQTTnet.Packets;
|
||||
|
||||
@@ -11,11 +12,11 @@ namespace MQTTnet.Server
|
||||
{
|
||||
public sealed class InterceptingPacketEventArgs : EventArgs
|
||||
{
|
||||
public InterceptingPacketEventArgs(CancellationToken cancellationToken, string clientId, string endpoint, MqttPacket packet, IDictionary sessionItems)
|
||||
public InterceptingPacketEventArgs(CancellationToken cancellationToken, string clientId, EndPoint remoteEndPoint, MqttPacket packet, IDictionary sessionItems)
|
||||
{
|
||||
CancellationToken = cancellationToken;
|
||||
ClientId = clientId ?? throw new ArgumentNullException(nameof(clientId));
|
||||
Endpoint = endpoint;
|
||||
RemoteEndPoint = remoteEndPoint;
|
||||
Packet = packet ?? throw new ArgumentNullException(nameof(packet));
|
||||
SessionItems = sessionItems;
|
||||
}
|
||||
@@ -34,7 +35,10 @@ namespace MQTTnet.Server
|
||||
/// <summary>
|
||||
/// Gets the endpoint of the sending or receiving client.
|
||||
/// </summary>
|
||||
public string Endpoint { get; }
|
||||
public EndPoint RemoteEndPoint { get; }
|
||||
|
||||
[Obsolete("Use RemoteEndPoint instead.")]
|
||||
public string Endpoint => RemoteEndPoint?.ToString();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the MQTT packet which was received or will be sent.
|
||||
|
||||
Reference in New Issue
Block a user