Move logger into WebSocketServerAdapter instead of creating a new instance.

This commit is contained in:
Christian Kratky
2019-03-10 15:58:55 +01:00
parent 2ca6866c5e
commit 510c3bd0bf
5 changed files with 31 additions and 18 deletions
@@ -30,8 +30,7 @@ namespace MQTTnet.AspNetCore
var adapter = app.ApplicationServices.GetRequiredService<MqttWebSocketServerAdapter>();
using (var webSocket = await context.WebSockets.AcceptWebSocketAsync(subProtocol))
{
var endpoint = $"{context.Connection.RemoteIpAddress}:{context.Connection.RemotePort}";
await adapter.RunWebSocketConnectionAsync(webSocket, endpoint);
await adapter.RunWebSocketConnectionAsync(webSocket, context);
}
});