144 references to WebSocketCloseStatus
dotnet-svcutil-lib (5)
ExceptionHandlerSample (1)
InProcessWebSite (1)
Interop.FunctionalTests (2)
Microsoft.AspNetCore.Http.Connections (3)
Microsoft.AspNetCore.Http.Connections.Client (7)
Microsoft.AspNetCore.Http.Connections.Tests (23)
TestWebSocketConnectionFeature.cs (8)
63private WebSocketCloseStatus? _closeStatus;
75public override WebSocketCloseStatus? CloseStatus => _closeStatus;
94public override async Task CloseAsync(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken)
109public override async Task CloseOutputAsync(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken)
225CloseStatus = WebSocketCloseStatus.InternalServerError,
249_closeStatus = WebSocketCloseStatus.InternalServerError;
250return new WebSocketConnectionSummary(frames, new WebSocketReceiveResult(0, WebSocketMessageType.Close, endOfMessage: true, closeStatus: WebSocketCloseStatus.InternalServerError, closeStatusDescription: ""));
282public WebSocketCloseStatus? CloseStatus { get; set; }
WebSocketsTests.cs (11)
52await feature.Client.CloseAsync(WebSocketCloseStatus.NormalClosure, "", CancellationToken.None);
67Assert.Equal(WebSocketCloseStatus.NormalClosure, clientSummary.CloseResult.CloseStatus);
100await feature.Client.CloseAsync(WebSocketCloseStatus.NormalClosure, "", CancellationToken.None);
190Assert.Equal(WebSocketCloseStatus.InternalServerError, clientSummary.CloseResult.CloseStatus);
193await feature.Client.CloseAsync(WebSocketCloseStatus.NormalClosure, "", CancellationToken.None);
298await feature.Client.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, null, CancellationToken.None).DefaultTimeout();
302Assert.Equal(WebSocketCloseStatus.NormalClosure, serverSocket.CloseStatus);
332await feature.Client.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, null, CancellationToken.None).DefaultTimeout();
341Assert.Equal(WebSocketCloseStatus.NormalClosure, serverSocket.CloseStatus);
386await feature.Client.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, null, CancellationToken.None).DefaultTimeout();
412await serverSocket.CloseAsync(WebSocketCloseStatus.NormalClosure, "", default);
Microsoft.AspNetCore.Owin (7)
Microsoft.AspNetCore.SignalR.Client.Tests (3)
Microsoft.AspNetCore.SignalR.Tests (5)
Microsoft.AspNetCore.TestHost (6)
Microsoft.AspNetCore.TestHost.Tests (7)
TestClientTests.cs (5)
590await websocket.CloseAsync(WebSocketCloseStatus.NormalClosure, "Normal Closure", CancellationToken.None);
620await clientSocket.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, "Normal Closure", CancellationToken.None);
658await websocket.CloseAsync(WebSocketCloseStatus.NormalClosure, "Normal Closure", CancellationToken.None);
667await websocket.CloseAsync(WebSocketCloseStatus.InternalServerError, closeReason, CancellationToken.None);
712await websocket.CloseAsync(WebSocketCloseStatus.NormalClosure, "Normal Closure", CancellationToken.None);
Microsoft.AspNetCore.WebSockets (3)
Microsoft.AspNetCore.WebSockets.Tests (14)
WebSocketMiddlewareTests.cs (12)
357Assert.Equal(WebSocketCloseStatus.NormalClosure, result.CloseStatus);
364await client.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, closeDescription, CancellationToken.None);
380await webSocket.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, closeDescription, CancellationToken.None);
391Assert.Equal(WebSocketCloseStatus.NormalClosure, result.CloseStatus);
413Assert.Equal(WebSocketCloseStatus.NormalClosure, result.CloseStatus);
422await client.CloseAsync(WebSocketCloseStatus.NormalClosure, closeDescription, CancellationToken.None);
443Assert.Equal(WebSocketCloseStatus.NormalClosure, result.CloseStatus);
452await client.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, closeDescription, CancellationToken.None);
455await client.CloseAsync(WebSocketCloseStatus.NormalClosure, closeDescription, CancellationToken.None);
470await webSocket.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, closeDescription, CancellationToken.None);
477Assert.Equal(WebSocketCloseStatus.NormalClosure, result.CloseStatus);
489Assert.Equal(WebSocketCloseStatus.NormalClosure, result.CloseStatus);
netstandard (1)
System (1)
System.Net.HttpListener (3)
System.Net.WebSockets (40)
System\Net\WebSockets\ManagedWebSocket.cs (32)
93private WebSocketCloseStatus? _closeStatus;
250public override WebSocketCloseStatus? CloseStatus => _closeStatus;
349public override Task CloseAsync(WebSocketCloseStatus closeStatus, string? statusDescription, CancellationToken cancellationToken)
365public override Task CloseOutputAsync(WebSocketCloseStatus closeStatus, string? statusDescription, CancellationToken cancellationToken)
371private async Task CloseOutputAsyncCore(WebSocketCloseStatus closeStatus, string? statusDescription, CancellationToken cancellationToken)
756await CloseWithReceiveErrorAndThrowAsync(WebSocketCloseStatus.ProtocolError, WebSocketError.Faulted, headerErrorMessage).ConfigureAwait(false);
881await CloseWithReceiveErrorAndThrowAsync(WebSocketCloseStatus.InvalidPayloadData, WebSocketError.Faulted).ConfigureAwait(false);
953WebSocketCloseStatus closeStatus = WebSocketCloseStatus.NormalClosure;
960await CloseWithReceiveErrorAndThrowAsync(WebSocketCloseStatus.ProtocolError, WebSocketError.Faulted).ConfigureAwait(false);
974closeStatus = (WebSocketCloseStatus)BinaryPrimitives.ReadUInt16BigEndian(_receiveBuffer.Span.Slice(_receiveBufferOffset));
977await CloseWithReceiveErrorAndThrowAsync(WebSocketCloseStatus.ProtocolError, WebSocketError.Faulted).ConfigureAwait(false);
988await CloseWithReceiveErrorAndThrowAsync(WebSocketCloseStatus.ProtocolError, WebSocketError.Faulted, innerException: exc).ConfigureAwait(false);
1070private static bool IsValidCloseStatus(WebSocketCloseStatus closeStatus)
1078if (closeStatus < (WebSocketCloseStatus)1000 || closeStatus >= (WebSocketCloseStatus)5000)
1083if (closeStatus >= (WebSocketCloseStatus)3000)
1090case WebSocketCloseStatus.EndpointUnavailable:
1091case WebSocketCloseStatus.InternalServerError:
1092case WebSocketCloseStatus.InvalidMessageType:
1093case WebSocketCloseStatus.InvalidPayloadData:
1094case WebSocketCloseStatus.MandatoryExtension:
1095case WebSocketCloseStatus.MessageTooBig:
1096case WebSocketCloseStatus.NormalClosure:
1097case WebSocketCloseStatus.PolicyViolation:
1098case WebSocketCloseStatus.ProtocolError:
1099case (WebSocketCloseStatus)1012: // ServiceRestart
1100case (WebSocketCloseStatus)1013: // TryAgainLater
1101case (WebSocketCloseStatus)1014: // BadGateway
1115WebSocketCloseStatus closeStatus, WebSocketError error, string? errorMessage = null, Exception? innerException = null)
1258private async Task CloseAsyncPrivate(WebSocketCloseStatus closeStatus, string? statusDescription, CancellationToken cancellationToken)
1337private async ValueTask SendCloseFrameAsync(WebSocketCloseStatus closeStatus, string? closeStatusDescription, CancellationToken cancellationToken)
System.Net.WebSockets.Client (6)
System.ServiceModel.Http (4)
WebSocketSample (2)