mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-20 03:24:33 +08:00
use the RemoteEndpoint property from the ConnectionContext and added test
This commit is contained in:
@@ -38,10 +38,9 @@ namespace MQTTnet.AspNetCore
|
||||
get
|
||||
{
|
||||
#if NETCOREAPP3_1
|
||||
var endpointFeature = Connection.Features.Get<Microsoft.AspNetCore.Connections.Features.IConnectionEndPointFeature>();
|
||||
if (endpointFeature != null)
|
||||
if (Connection?.RemoteEndPoint != null)
|
||||
{
|
||||
return endpointFeature.RemoteEndPoint.ToString();
|
||||
return Connection.RemoteEndPoint.ToString();
|
||||
}
|
||||
#endif
|
||||
var connection = Http?.HttpContext?.Connection;
|
||||
|
||||
Reference in New Issue
Block a user