log when WebSocketTransport has started (#2752)
This commit is contained in:
parent
da35d1f4e1
commit
b82fcc0b21
|
|
@ -66,6 +66,9 @@ namespace Microsoft.AspNetCore.Http.Connections.Client.Internal
|
|||
private static readonly Action<ILogger, Exception> _cancelMessage =
|
||||
LoggerMessage.Define(LogLevel.Debug, new EventId(18, "CancelMessage"), "Canceled passing message to application.");
|
||||
|
||||
private static readonly Action<ILogger, Exception> _startedTransport =
|
||||
LoggerMessage.Define(LogLevel.Debug, new EventId(19, "StartedTransport"), "Started transport.");
|
||||
|
||||
public static void StartTransport(ILogger logger, TransferFormat transferFormat, Uri webSocketUrl)
|
||||
{
|
||||
_startTransport(logger, transferFormat, webSocketUrl, null);
|
||||
|
|
@ -155,6 +158,11 @@ namespace Microsoft.AspNetCore.Http.Connections.Client.Internal
|
|||
{
|
||||
_cancelMessage(logger, null);
|
||||
}
|
||||
|
||||
public static void StartedTransport(ILogger logger)
|
||||
{
|
||||
_startedTransport(logger, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,8 +107,6 @@ namespace Microsoft.AspNetCore.Http.Connections.Client.Internal
|
|||
|
||||
var resolvedUrl = ResolveWebSocketsUrl(url);
|
||||
|
||||
Log.StartTransport(_logger, transferFormat, resolvedUrl);
|
||||
|
||||
// We don't need to capture to a local because we never change this delegate.
|
||||
if (_accessTokenProvider != null)
|
||||
{
|
||||
|
|
@ -119,8 +117,12 @@ namespace Microsoft.AspNetCore.Http.Connections.Client.Internal
|
|||
}
|
||||
}
|
||||
|
||||
Log.StartTransport(_logger, transferFormat, resolvedUrl);
|
||||
|
||||
await _webSocket.ConnectAsync(resolvedUrl, CancellationToken.None);
|
||||
|
||||
Log.StartedTransport(_logger);
|
||||
|
||||
// Create the pipe pair (Application's writer is connected to Transport's reader, and vice versa)
|
||||
var options = ClientPipeOptions.DefaultOptions;
|
||||
var pair = DuplexPipe.CreateConnectionPair(options, options);
|
||||
|
|
|
|||
Loading…
Reference in New Issue