65 references to WebSocketError
dotnet-svcutil-lib (3)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ClientWebSocketTransportDuplexSessionChannel.cs (3)
101new WebSocketException(WebSocketError.ConnectionClosedPrematurely).Message); 158case WebSocketError.UnsupportedVersion: 160case WebSocketError.UnsupportedProtocol:
Microsoft.AspNetCore.Http.Connections (1)
Internal\Transports\WebSocketsServerTransport.cs (1)
173catch (WebSocketException ex) when (ex.WebSocketErrorCode == WebSocketError.ConnectionClosedPrematurely)
Microsoft.AspNetCore.Http.Connections.Tests (3)
TestWebSocketConnectionFeature.cs (2)
91_output.TryComplete(new WebSocketException(WebSocketError.ConnectionClosedPrematurely)); 177case WebSocketError.ConnectionClosedPrematurely:
WebSocketsTests.cs (1)
137Assert.IsType<WebSocketError>(ex);
Microsoft.AspNetCore.WebSockets.Tests (1)
SendReceiveTests.cs (1)
101Assert.Equal(WebSocketError.ConnectionClosedPrematurely, ex.WebSocketErrorCode);
netstandard (1)
netstandard.cs (1)
1315[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Net.WebSockets.WebSocketError))]
System (1)
src\libraries\shims\System\ref\System.cs (1)
806[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Net.WebSockets.WebSocketError))]
System.Net.HttpListener (6)
System\Net\WebSockets\HttpWebSocket.cs (6)
41throw new WebSocketException(WebSocketError.UnsupportedProtocol, 73throw new WebSocketException(WebSocketError.UnsupportedProtocol, 108throw new WebSocketException(WebSocketError.NotAWebSocket, 120throw new WebSocketException(WebSocketError.HeaderError, 128throw new WebSocketException(WebSocketError.UnsupportedVersion, 151throw new WebSocketException(WebSocketError.HeaderError,
System.Net.WebSockets (39)
System\Net\WebSockets\ManagedWebSocket.cs (11)
549new WebSocketException(WebSocketError.ConnectionClosedPrematurely, exc)); 590new WebSocketException(WebSocketError.ConnectionClosedPrematurely, exc); 630new WebSocketException(WebSocketError.ConnectionClosedPrematurely, exc); 854await CloseWithReceiveErrorAndThrowAsync(WebSocketCloseStatus.ProtocolError, WebSocketError.Faulted, headerErrorMessage).ConfigureAwait(false); 988await CloseWithReceiveErrorAndThrowAsync(WebSocketCloseStatus.InvalidPayloadData, WebSocketError.Faulted).ConfigureAwait(false); 1038throw new WebSocketException(WebSocketError.ConnectionClosedPrematurely, exc); 1093await CloseWithReceiveErrorAndThrowAsync(WebSocketCloseStatus.ProtocolError, WebSocketError.Faulted).ConfigureAwait(false); 1110await CloseWithReceiveErrorAndThrowAsync(WebSocketCloseStatus.ProtocolError, WebSocketError.Faulted).ConfigureAwait(false); 1121await CloseWithReceiveErrorAndThrowAsync(WebSocketCloseStatus.ProtocolError, WebSocketError.Faulted, innerException: exc).ConfigureAwait(false); 1275WebSocketCloseStatus closeStatus, WebSocketError error, string? errorMessage = null, Exception? innerException = null) 1620throw new WebSocketException(WebSocketError.ConnectionClosedPrematurely);
System\Net\WebSockets\ManagedWebSocket.KeepAlive.cs (1)
82new WebSocketException(WebSocketError.Faulted, SR.net_Websockets_KeepAlivePingTimeout));
System\Net\WebSockets\WebSocket.cs (1)
107throw new WebSocketException(WebSocketError.InvalidState, SR.Format(SR.net_WebSockets_InvalidState, state, validStatesText));
System\Net\WebSockets\WebSocketException.cs (25)
15private readonly WebSocketError _webSocketErrorCode; 22public WebSocketException(WebSocketError error) 27public WebSocketException(WebSocketError error, string? message) : base(message ?? SR.net_WebSockets_Generic) 32public WebSocketException(WebSocketError error, Exception? innerException) 37public WebSocketException(WebSocketError error, string? message, Exception? innerException) 46_webSocketErrorCode = !Succeeded(nativeError) ? WebSocketError.NativeError : WebSocketError.Success; 53_webSocketErrorCode = !Succeeded(nativeError) ? WebSocketError.NativeError : WebSocketError.Success; 60_webSocketErrorCode = !Succeeded(nativeError) ? WebSocketError.NativeError : WebSocketError.Success; 64public WebSocketException(WebSocketError error, int nativeError) 69public WebSocketException(WebSocketError error, int nativeError, string? message) 76public WebSocketException(WebSocketError error, int nativeError, Exception? innerException) 81public WebSocketException(WebSocketError error, int nativeError, string? message, Exception? innerException) 121public WebSocketError WebSocketErrorCode 129private static string GetErrorMessage(WebSocketError error) => 133WebSocketError.InvalidMessageType => SR.Format(SR.net_WebSockets_InvalidMessageType_Generic, 136WebSocketError.Faulted => SR.net_Websockets_WebSocketBaseFaulted, 137WebSocketError.NotAWebSocket => SR.net_WebSockets_NotAWebSocket_Generic, 138WebSocketError.UnsupportedVersion => SR.net_WebSockets_UnsupportedWebSocketVersion_Generic, 139WebSocketError.UnsupportedProtocol => SR.net_WebSockets_UnsupportedProtocol_Generic, 140WebSocketError.HeaderError => SR.net_WebSockets_HeaderError_Generic, 141WebSocketError.ConnectionClosedPrematurely => SR.net_WebSockets_ConnectionClosedPrematurely_Generic, 142WebSocketError.InvalidState => SR.net_WebSockets_InvalidState_Generic,
System\Net\WebSockets\WebSocketStateHelper.cs (1)
30throw new WebSocketException(WebSocketError.InvalidState, invalidStateMessage, innerException);
System.Net.WebSockets.Client (10)
System\Net\WebSockets\WebSocketHandle.Managed.cs (10)
85throw new WebSocketException(WebSocketError.UnsupportedProtocol); 97throw new WebSocketException(WebSocketError.UnsupportedProtocol); 171WebSocketError.UnsupportedProtocol, 222throw new WebSocketException(WebSocketError.Faulted, SR.net_webstatus_ConnectFailure, exc); 347throw new WebSocketException(WebSocketError.HeaderError, 455throw new WebSocketException(WebSocketError.NotAWebSocket, SR.Format(SR.net_WebSockets_ConnectStatusExpected, (int)response.StatusCode, (int)HttpStatusCode.SwitchingProtocols)); 469throw new WebSocketException(WebSocketError.NotAWebSocket, SR.Format(SR.net_WebSockets_ConnectStatusExpected, (int)response.StatusCode, (int)HttpStatusCode.OK)); 475throw new WebSocketException(WebSocketError.ConnectionClosedPrematurely); 527throw new WebSocketException(WebSocketError.HeaderError, SR.Format(SR.net_WebSockets_InvalidResponseHeader, name, hsv)); 530throw new WebSocketException(WebSocketError.Faulted, SR.Format(SR.net_WebSockets_MissingResponseHeader, name));