171 references to WebSocketCloseStatus
Aspire.Dashboard (11)
Aspire.Dashboard.Tests (45)
Terminal\TerminalWebSocketTests.cs (38)
35await browser.CloseAsync(WebSocketCloseStatus.NormalClosure, "Detach", timeout.Token);
86await browser.CloseAsync(WebSocketCloseStatus.NormalClosure, "Detach", timeout.Token);
126await browser.CloseAsync(WebSocketCloseStatus.NormalClosure, "Reconnect", timeout.Token);
130await reconnected.CloseAsync(WebSocketCloseStatus.NormalClosure, "Done", timeout.Token);
159await first.CloseAsync(WebSocketCloseStatus.NormalClosure, "Reconnect", timeout.Token);
164await second.CloseAsync(WebSocketCloseStatus.NormalClosure, "Done", timeout.Token);
193await browser.CloseAsync(WebSocketCloseStatus.NormalClosure, "Done", timeout.Token);
225Assert.Equal(WebSocketCloseStatus.PolicyViolation, result.CloseStatus);
245await browser.CloseAsync(WebSocketCloseStatus.NormalClosure, "Done", timeout.Token);
251await reconnected.CloseAsync(WebSocketCloseStatus.NormalClosure, "Done", timeout.Token);
298await first.CloseAsync(WebSocketCloseStatus.NormalClosure, "Reconnect", timeout.Token);
302await reconnected.CloseAsync(WebSocketCloseStatus.NormalClosure, "Done", timeout.Token);
303await second.CloseAsync(WebSocketCloseStatus.NormalClosure, "Done", timeout.Token);
350await first.CloseAsync(WebSocketCloseStatus.NormalClosure, "Done", timeout.Token);
351await late.CloseAsync(WebSocketCloseStatus.NormalClosure, "Done", timeout.Token);
386await first.CloseAsync(WebSocketCloseStatus.NormalClosure, "Done", timeout.Token);
387await late.CloseAsync(WebSocketCloseStatus.NormalClosure, "Done", timeout.Token);
414await browser.CloseAsync(WebSocketCloseStatus.NormalClosure, "Reconnect", timeout.Token);
419await reconnected.CloseAsync(WebSocketCloseStatus.NormalClosure, "Done", timeout.Token);
456await first.CloseAsync(WebSocketCloseStatus.NormalClosure, "Detach", timeout.Token);
458Assert.Equal(WebSocketCloseStatus.NormalClosure, first.CloseStatus);
475await second.CloseAsync(WebSocketCloseStatus.NormalClosure, "Done", timeout.Token);
532await browser.CloseAsync(WebSocketCloseStatus.NormalClosure, "Done", timeout.Token);
570await readOnly.CloseAsync(WebSocketCloseStatus.NormalClosure, "Done", timeout.Token);
571await interactive.CloseAsync(WebSocketCloseStatus.NormalClosure, "Done", timeout.Token);
597Assert.Equal(WebSocketCloseStatus.PolicyViolation, close.CloseStatus);
599await browser.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, "Received", timeout.Token);
623Assert.Equal((WebSocketCloseStatus)4000, result.CloseStatus);
627await browser.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, "Received", timeout.Token);
672Assert.Equal((WebSocketCloseStatus)4000, result.CloseStatus);
675await browser.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, "Received", timeout.Token);
714Assert.Equal((WebSocketCloseStatus)4000, close.CloseStatus);
716await browser.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, "Received", timeout.Token);
745Assert.Equal(useGrpc ? (WebSocketCloseStatus)4000 : WebSocketCloseStatus.EndpointUnavailable, close.CloseStatus);
746await browser.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, "Received", timeout.Token);
774Assert.Equal(WebSocketCloseStatus.EndpointUnavailable, closed.CloseStatus);
776await browser.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, "Received", timeout.Token);
Aspire.Hosting.Browsers (1)
Aspire.Hosting.Browsers.Tests (3)
dotnet-svcutil-lib (5)
Microsoft.AspNetCore.Http.Connections (6)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\LoggerMessage.g.cs (3)
808private static readonly global::System.Action<global::Microsoft.Extensions.Logging.ILogger, global::System.Net.WebSockets.WebSocketCloseStatus?, string, global::System.Exception?> __ClientClosedCallback =
809global::Microsoft.Extensions.Logging.LoggerMessage.Define<global::System.Net.WebSockets.WebSocketCloseStatus?, string>(global::Microsoft.Extensions.Logging.LogLevel.Debug, new global::Microsoft.Extensions.Logging.EventId(3, "ClientClosed"), "Client closed connection with status code '{Status}' ({Description}). Signaling end-of-input to application.", new global::Microsoft.Extensions.Logging.LogDefineOptions() { SkipEnabledCheck = true });
816public static partial void ClientClosed(global::Microsoft.Extensions.Logging.ILogger logger, global::System.Net.WebSockets.WebSocketCloseStatus? status, string description)
Microsoft.AspNetCore.Http.Connections.Client (10)
Microsoft.AspNetCore.Owin (7)
Microsoft.AspNetCore.TestHost (6)
Microsoft.AspNetCore.Watch.BrowserRefresh (1)
netstandard (1)
System (1)
System.Net.HttpListener (6)
System.Net.WebSockets (41)
System\Net\WebSockets\ManagedWebSocket.cs (32)
86private WebSocketCloseStatus? _closeStatus;
289public override WebSocketCloseStatus? CloseStatus => _closeStatus;
387public override Task CloseAsync(WebSocketCloseStatus closeStatus, string? statusDescription, CancellationToken cancellationToken)
406public override Task CloseOutputAsync(WebSocketCloseStatus closeStatus, string? statusDescription, CancellationToken cancellationToken)
414private async Task CloseOutputAsyncCore(WebSocketCloseStatus closeStatus, string? statusDescription, bool enterReceiveMutex, CancellationToken cancellationToken)
863await CloseWithReceiveErrorAndThrowAsync(WebSocketCloseStatus.ProtocolError, WebSocketError.Faulted, headerErrorMessage).ConfigureAwait(false);
996await CloseWithReceiveErrorAndThrowAsync(WebSocketCloseStatus.InvalidPayloadData, WebSocketError.Faulted, SR.net_Websockets_InvalidTextPayload).ConfigureAwait(false);
1094WebSocketCloseStatus closeStatus = WebSocketCloseStatus.NormalClosure;
1101await CloseWithReceiveErrorAndThrowAsync(WebSocketCloseStatus.ProtocolError, WebSocketError.Faulted, SR.net_Websockets_ProtocolViolation).ConfigureAwait(false);
1115closeStatus = (WebSocketCloseStatus)BinaryPrimitives.ReadUInt16BigEndian(_receiveBuffer.Span.Slice(_receiveBufferOffset));
1118await CloseWithReceiveErrorAndThrowAsync(WebSocketCloseStatus.ProtocolError, WebSocketError.Faulted, SR.net_Websockets_InvalidCloseStatusCodeReceived).ConfigureAwait(false);
1129await CloseWithReceiveErrorAndThrowAsync(WebSocketCloseStatus.ProtocolError, WebSocketError.Faulted, SR.net_Websockets_InvalidCloseDescriptionPayload, exc).ConfigureAwait(false);
1256private static bool IsValidCloseStatus(WebSocketCloseStatus closeStatus)
1264if (closeStatus < (WebSocketCloseStatus)1000 || closeStatus >= (WebSocketCloseStatus)5000)
1269if (closeStatus >= (WebSocketCloseStatus)3000)
1276case WebSocketCloseStatus.EndpointUnavailable:
1277case WebSocketCloseStatus.InternalServerError:
1278case WebSocketCloseStatus.InvalidMessageType:
1279case WebSocketCloseStatus.InvalidPayloadData:
1280case WebSocketCloseStatus.MandatoryExtension:
1281case WebSocketCloseStatus.MessageTooBig:
1282case WebSocketCloseStatus.NormalClosure:
1283case WebSocketCloseStatus.PolicyViolation:
1284case WebSocketCloseStatus.ProtocolError:
1285case (WebSocketCloseStatus)1012: // ServiceRestart
1286case (WebSocketCloseStatus)1013: // TryAgainLater
1287case (WebSocketCloseStatus)1014: // BadGateway
1301WebSocketCloseStatus closeStatus, WebSocketError error, string? errorMessage = null, Exception? innerException = null)
1453private async Task CloseAsyncPrivate(WebSocketCloseStatus closeStatus, string? statusDescription, CancellationToken cancellationToken)
1557private async ValueTask SendCloseFrameAsync(WebSocketCloseStatus closeStatus, string? closeStatusDescription, CancellationToken cancellationToken)
System.Net.WebSockets.Client (23)
System.ServiceModel.Http (4)