enable websocket on netstandard (#899)

* enable websocket on netstandard

* happy build
This commit is contained in:
Boshi Lian
2022-06-28 15:17:35 -07:00
committed by GitHub
parent ef90174bd8
commit 56646aeed3
5 changed files with 52 additions and 5 deletions

View File

@@ -210,6 +210,9 @@ namespace k8s
cancellationToken);
}
partial void BeforeRequest();
partial void AfterRequest();
protected async Task<WebSocket> StreamConnectAsync(Uri uri, string webSocketSubProtocol = null, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default)
{
if (uri == null)
@@ -280,6 +283,7 @@ namespace k8s
WebSocket webSocket = null;
try
{
BeforeRequest();
webSocket = await webSocketBuilder.BuildAndConnectAsync(uri, CancellationToken.None)
.ConfigureAwait(false);
}
@@ -335,6 +339,10 @@ namespace k8s
{
throw;
}
finally
{
AfterRequest();
}
return webSocket;
}