40 instantiations of WebSocketException
Aspire.Hosting.Browsers.Tests (2)
BrowserConnectionDiagnosticsLoggerTests.cs (1)
30new InvalidOperationException("Connecting to the tracked browser debug endpoint failed.", new WebSocketException("Connection refused")));
BrowserLogsCdpConnectionTests.cs (1)
20var connectException = new WebSocketException("Connection refused");
dotnet-svcutil-lib (1)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ClientWebSocketTransportDuplexSessionChannel.cs (1)
101new WebSocketException(WebSocketError.ConnectionClosedPrematurely).Message);
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 (15)
System\Net\WebSockets\Compression\WebSocketDeflater.cs (2)
204throw new WebSocketException(message); 218throw new WebSocketException(ex.Message, ex.InnerException);
System\Net\WebSockets\Compression\WebSocketInflater.cs (3)
166throw new WebSocketException(SR.net_WebSockets_DataAfterBFinal); 266throw new WebSocketException(message); 277throw new WebSocketException(ex.Message, ex.InnerException);
System\Net\WebSockets\ManagedWebSocket.cs (7)
544ExceptionDispatchInfo.SetCurrentStackTrace(new WebSocketException(WebSocketError.ConnectionClosedPrematurely, exc))); 585new WebSocketException(WebSocketError.ConnectionClosedPrematurely, exc); 637new WebSocketException(WebSocketError.ConnectionClosedPrematurely, exc); 1046throw new WebSocketException(WebSocketError.ConnectionClosedPrematurely, exc); 1318new WebSocketException(error, errorMessage, innerException) : 1319new WebSocketException(error, innerException); 1651throw 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\WebSocketStateHelper.cs (1)
30throw new WebSocketException(WebSocketError.InvalidState, invalidStateMessage, innerException);
System.Net.WebSockets.Client (15)
System\Net\WebSockets\BrowserWebSockets\BrowserWebSocket.cs (15)
325throw new WebSocketException(WebSocketError.Faulted, SR.net_webstatus_ConnectFailure); 352throw new WebSocketException(WebSocketError.Faulted, SR.net_webstatus_ConnectFailure, ex); 409throw new WebSocketException(WebSocketError.InvalidState, SR.Format(SR.net_WebSockets_InvalidState, previousState, "Open"), ex); 411throw new WebSocketException(WebSocketError.NativeError, ex); 434throw new WebSocketException(WebSocketError.InvalidState, SR.Format(SR.net_WebSockets_InvalidState, previousState, "Open, CloseSent")); 454throw new WebSocketException(WebSocketError.InvalidState, SR.Format(SR.net_WebSockets_InvalidState, previousState, "Open, CloseSent"), ex); 456throw new WebSocketException(WebSocketError.NativeError, ex); 495throw new WebSocketException(WebSocketError.InvalidMessageType, _closeStatusDescription); 497throw new WebSocketException(WebSocketError.NotAWebSocket, _closeStatusDescription); 499throw new WebSocketException(WebSocketError.UnsupportedProtocol, _closeStatusDescription); 501throw new WebSocketException(WebSocketError.Faulted, _closeStatusDescription); 503throw new WebSocketException(WebSocketError.NativeError, (int)_closeStatus!.Value, _closeStatusDescription); 522throw new WebSocketException(WebSocketError.InvalidState, SR.Format(SR.net_WebSockets_InvalidState, previousState, "Connecting, Open, CloseSent, CloseReceived, Aborted")); 599throw new WebSocketException(WebSocketError.Faulted, SR.net_webstatus_ConnectFailure, ex); 601throw new WebSocketException(WebSocketError.NativeError, ex);
System.ServiceModel.Http (1)
System\ServiceModel\Channels\ClientWebSocketTransportDuplexSessionChannel.cs (1)
85new WebSocketException(WebSocketError.ConnectionClosedPrematurely).Message);
24 references to WebSocketException
Aspire.Dashboard (2)
Terminal\TerminalWebSocketProxy.cs (2)
340catch (Exception ex) when (ex is IOException or WebSocketException or RpcException) 485catch (Exception ex) when (ex is WebSocketException or OperationCanceledException or InvalidOperationException)
Aspire.Dashboard.Tests (3)
Terminal\TerminalWebSocketTests.cs (3)
440await Assert.ThrowsAsync<WebSocketException>(() => host.ConnectBrowserAsync(timeout.Token)); 650var exception = await Assert.ThrowsAsync<WebSocketException>(() => host.ConnectBrowserAsync(session, timeout.Token));
Aspire.Hosting.Browsers.Tests (3)
BrowserLogsCdpConnectionTests.cs (3)
20var connectException = new WebSocketException("Connection refused"); 23var exception = await Assert.ThrowsAsync<WebSocketException>(() => BrowserLogsCdpConnection.ConnectAsync(
dotnet-svcutil-lib (2)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ClientWebSocketTransportDuplexSessionChannel.cs (2)
124catch (WebSocketException ex) 149private static void TryConvertAndThrow(WebSocketException ex)
Microsoft.AspNetCore.Http.Connections (2)
Internal\HttpConnectionManager.cs (1)
213catch (WebSocketException ex) when (ex.InnerException is IOException)
Internal\Transports\WebSocketsServerTransport.cs (1)
173catch (WebSocketException ex) when (ex.WebSocketErrorCode == WebSocketError.ConnectionClosedPrematurely)
Microsoft.AspNetCore.SpaServices.Extensions (1)
Proxying\SpaProxy.cs (1)
254catch (WebSocketException)
Microsoft.AspNetCore.Watch.BrowserRefresh (2)
src\sdk\src\Dotnet.Watch\Web.Middleware\BrowserToolsForwarder.cs (2)
127catch (WebSocketException exception) 269catch (WebSocketException) when (destination.State is WebSocketState.Aborted or WebSocketState.Closed)
Microsoft.DotNet.HotReload.Watch (1)
src\sdk\src\Dotnet.Watch\HotReloadClient\WebSocketClientTransport.cs (1)
49|| (exception is System.Net.WebSockets.WebSocketException && _handler.IsClientSocketAborted);
Microsoft.Extensions.AI.OpenAI.Tests (2)
OpenAIRealtimeClientSessionTests.cs (1)
93ex is OperationCanceledException || ex is System.Net.WebSockets.WebSocketException,
OpenAIRealtimeClientTests.cs (1)
60ex is OperationCanceledException || ex is System.Net.WebSockets.WebSocketException,
netstandard (1)
netstandard.cs (1)
1316[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Net.WebSockets.WebSocketException))]
ScenarioTests.Common.Tests (1)
ScenarioTestHelpers.cs (1)
213catch (System.Net.WebSockets.WebSocketException)
System (1)
parent\ref\System.cs (1)
807[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Net.WebSockets.WebSocketException))]
System.Net.WebSockets (1)
System\Net\WebSockets\ManagedWebSocket.cs (1)
1041if (exc is WebSocketException)
System.ServiceModel.Http (2)
System\ServiceModel\Channels\ClientWebSocketTransportDuplexSessionChannel.cs (2)
108catch (WebSocketException ex) 249private static void TryConvertAndThrow(WebSocketException ex)