56 instantiations of SocketException
dotnet-svcutil-lib (2)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\CoreClrSocketConnection.cs (2)
486
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
SocketException
((int)_asyncWriteEventArgs.SocketError));
725
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
SocketException
((int)_asyncReadEventArgs.SocketError));
System.Net.NameResolution (2)
System\Net\Dns.cs (2)
480
exception = new
SocketException
((int)SocketError.HostNotFound);
984
new
SocketException
((int)error) { HResult = nativeError };
System.Net.Ping (1)
src\runtime\src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (1)
29
throw new
SocketException
((int)SocketError.AddressFamilyNotSupported);
System.Net.Primitives (4)
src\runtime\src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (1)
29
throw new
SocketException
((int)SocketError.AddressFamilyNotSupported);
System\Net\IPAddress.cs (2)
773
private void ThrowSocketOperationNotSupported() => throw new
SocketException
(SocketError.OperationNotSupported, SR.Format(SR.net_SocketException_OperationNotSupported, AddressFamily));
776
private static void ThrowSocketOperationNotSupportedReadOnly() => throw new
SocketException
(SocketError.OperationNotSupported, SR.net_SocketException_OperationNotSupported_ReadOnlyIPAddress);
System\Net\IPAddressParser.cs (1)
59
throw new FormatException(SR.dns_bad_ip_address, new
SocketException
(SocketError.InvalidArgument));
System.Net.Quic (6)
src\runtime\src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (1)
29
throw new
SocketException
((int)SocketError.AddressFamilyNotSupported);
System\Net\Quic\Internal\ThrowHelper.cs (4)
83
if (status == QUIC_STATUS_INVALID_ADDRESS) return new
SocketException
((int)SocketError.AddressNotAvailable);
84
if (status == QUIC_STATUS_ADDRESS_IN_USE) return new
SocketException
((int)SocketError.AddressAlreadyInUse);
85
if (status == QUIC_STATUS_UNREACHABLE) return new
SocketException
((int)SocketError.HostUnreachable);
86
if (status == QUIC_STATUS_ADDRESS_NOT_AVAILABLE) return new
SocketException
((int)SocketError.AddressFamilyNotSupported);
System\Net\Quic\QuicConnection.cs (1)
401
throw new
SocketException
((int)SocketError.HostNotFound);
System.Net.Sockets (39)
src\runtime\src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (1)
29
throw new
SocketException
((int)SocketError.AddressFamilyNotSupported);
src\runtime\src\libraries\Common\src\System\Net\Sockets\SocketExceptionFactory.Unix.cs (1)
18
return new
SocketException
(socketError, CreateMessage(nativeErr, endPoint));
System\Net\Sockets\Socket.cs (19)
92
throw new
SocketException
((int)errorCode);
1132
throw new
SocketException
((int)errorCode);
1161
if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(this, new
SocketException
((int)errorCode));
1183
throw new
SocketException
((int)errorCode);
1209
if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(this, new
SocketException
((int)errorCode));
1236
throw new
SocketException
((int)errorCode);
1254
if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(this, new
SocketException
((int)errorCode));
1535
throw new
SocketException
((int)errorCode);
1558
if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(this, new
SocketException
((int)errorCode));
1581
throw new
SocketException
((int)errorCode);
1599
if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(this, new
SocketException
((int)errorCode));
1626
throw new
SocketException
((int)errorCode);
1656
if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(this, new
SocketException
((int)errorCode));
1840
socketException = new
SocketException
((int)errorCode);
1964
socketException = new
SocketException
((int)errorCode);
2040
SocketException socketException = new
SocketException
((int)errorCode);
2424
throw new
SocketException
((int)errorCode);
3924
var socketException = new
SocketException
((int)error);
4050
throw new
SocketException
((int)SocketError.IsConnected);
System\Net\Sockets\Socket.Tasks.cs (3)
162
throw new
SocketException
((int)SocketError.IsConnected);
903
Exception e = ExceptionDispatchInfo.SetCurrentStackTrace(new
SocketException
((int)error));
1370
Exception e = new
SocketException
((int)error);
System\Net\Sockets\Socket.Unix.cs (4)
73
throw new
SocketException
((int)SocketError.NotSocket);
81
throw new
SocketException
((int)SocketError.NotSocket);
127
throw new
SocketException
((int)errorCode);
177
throw new
SocketException
((int)SocketError.InvalidArgument);
System\Net\Sockets\SocketAsyncContext.Unix.cs (1)
1367
throw new
SocketException
((int)SocketPal.GetSocketErrorForErrorCode(Interop.Sys.GetLastError()));
System\Net\Sockets\SocketAsyncEventArgs.cs (2)
835
caughtException = new
SocketException
((int)lastError);
840
caughtException = new
SocketException
((int)SocketError.OperationAborted);
System\Net\Sockets\SocketPal.Unix.cs (4)
2123
throw new
SocketException
((int)error);
2134
throw new
SocketException
((int)error);
2180
throw new
SocketException
((int)GetSocketErrorForErrorCode(err));
2194
throw new
SocketException
((int)errorCode);
System\Net\Sockets\UDPClient.cs (4)
432
throw new
SocketException
((int)SocketError.OperationNotSupported);
452
throw new
SocketException
((int)SocketError.OperationNotSupported);
520
throw new
SocketException
((int)SocketError.OperationNotSupported);
800
throw new
SocketException
((int)SocketError.NotConnected);
System.ServiceModel.NetTcp (1)
System\ServiceModel\Channels\SocketAwaitableEventArgs.cs (1)
103
return new
SocketException
((int)e);
System.ServiceModel.UnixDomainSocket (1)
System\ServiceModel\Channels\SocketAwaitableEventArgs.cs (1)
103
return new
SocketException
((int)e);
164 references to SocketException
aspire (8)
Backchannel\AppHostCliBackchannel.cs (1)
377
catch (
SocketException
) when (DateTime.UtcNow - startTime < maxWait)
Backchannel\AuxiliaryBackchannelMonitor.cs (1)
355
catch (
SocketException
ex) when (ex.SocketErrorCode == SocketError.ConnectionRefused)
Backchannel\ExtensionBackchannel.cs (1)
119
catch (
SocketException
ex)
DotNet\DotNetCliRunner.cs (2)
177
catch (
SocketException
ex) when (execution is not null && execution.HasExited && execution.ExitCode != 0)
185
catch (
SocketException
ex)
Projects\AppHostRpcClient.cs (1)
140
catch (
SocketException
)
Projects\GuestAppHostProject.cs (2)
962
catch (
SocketException
ex) when (process.HasExited && process.ExitCode != 0)
969
catch (
SocketException
)
Aspire.Dashboard.Tests (2)
Integration\ServerRetryHelper.cs (2)
171
catch (
SocketException
ex) when (ex.SocketErrorCode == SocketError.AddressAlreadyInUse)
176
catch (
SocketException
ex)
Aspire.Hosting (1)
Backchannel\AuxiliaryBackchannelService.cs (1)
177
catch (IOException ex) when (ex.InnerException is
SocketException
{ SocketErrorCode: SocketError.ConnectionReset })
Aspire.Hosting.Tests (1)
Helpers\Network.cs (1)
36
ShouldHandle = new PredicateBuilder<int>().Handle<
SocketException
>(),
Aspire.RabbitMQ.Client (1)
src\Components\Aspire.RabbitMQ.Client\AspireRabbitMQExtensions.cs (1)
193
ShouldHandle = static args => args.Outcome is { Exception:
SocketException
or BrokerUnreachableException }
dotnet-svcutil-lib (21)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\CoreClrSocketConnection.cs (7)
348
catch (
SocketException
socketException)
400
catch (
SocketException
socketException)
462
catch (
SocketException
socketException)
543
catch (
SocketException
socketException)
586
catch (
SocketException
socketException)
662
catch (
SocketException
socketException)
702
catch (
SocketException
socketException)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\DnsCache.cs (3)
63
catch (
SocketException
)
105
SocketException
dnsException = null;
110
catch (
SocketException
e)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\SocketConnection.cs (11)
170
protected Exception ConvertSendException(
SocketException
socketException, TimeSpan remainingTime)
176
protected Exception ConvertReceiveException(
SocketException
socketException, TimeSpan remainingTime)
182
internal static Exception ConvertTransferException(
SocketException
socketException, TimeSpan timeout, Exception originalException)
204
private static Exception ConvertTransferException(
SocketException
socketException, TimeSpan timeout, Exception originalException,
435
public static Exception ConvertConnectException(
SocketException
socketException, Uri remoteUri, TimeSpan timeSpent, Exception innerException)
497
catch (
SocketException
socketException)
513
SocketException
innerException)
540
SocketException
lastException = null;
564
catch (
SocketException
socketException)
592
SocketException
lastException = null;
616
catch (
SocketException
socketException)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (1)
Internal\QuicConnectionListener.cs (1)
134
catch (
SocketException
e) when (e.SocketErrorCode == SocketError.AddressAlreadyInUse)
Microsoft.Diagnostics.NETCore.Client (2)
DiagnosticsIpc\IpcTransport.cs (2)
94
catch (
SocketException
ex)
132
catch (
SocketException
ex)
Microsoft.DotNet.HotReload.Watch (2)
src\sdk\src\Dotnet.Watch\AspireService\Helpers\SocketUtilities.cs (1)
80
catch (
SocketException
)
src\sdk\src\Dotnet.Watch\HotReloadClient\NamedPipeClientTransport.cs (1)
62
return e is ObjectDisposedException or EndOfStreamException or
SocketException
{ ErrorCode: 125 }
Microsoft.Extensions.Diagnostics.ExceptionSummarization (3)
ExceptionSummarizationBuilderExtensions.cs (1)
17
/// Registers a summary provider that handles <see cref="OperationCanceledException"/>, <see cref="WebException"/>, and <see cref="
SocketException
"/> .
HttpExceptionSummaryProvider.cs (2)
77
typeof(
SocketException
),
104
case
SocketException
ex:
Microsoft.Extensions.Diagnostics.Probes (1)
TcpEndpointProbesService.cs (1)
57
catch (
SocketException
ex)
Microsoft.Extensions.Diagnostics.Probes.Tests (1)
TcpEndpointProbesServiceTests.cs (1)
107
catch (
SocketException
e)
Microsoft.Extensions.ServiceDiscovery.Dns (1)
Resolver\DnsResolver.cs (1)
386
catch (
SocketException
ex)
Microsoft.NET.Build.Containers (1)
AuthHandshakeMessageHandler.cs (1)
616
catch (HttpRequestException e) when (e.InnerException is IOException ioe && ioe.InnerException is
SocketException
se)
Microsoft.TestPlatform.CommunicationUtilities (4)
SocketCommunicationManager.cs (1)
375
if (ioException.InnerException is
SocketException
socketException
SocketServer.cs (1)
75
catch (
SocketException
ex)
TcpClientExtensions.cs (2)
37
catch (
SocketException
socketException)
72
if (ioException.InnerException is
SocketException
socketException
netstandard (1)
netstandard.cs (1)
1272
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Net.Sockets.
SocketException
))]
NuGet.Protocol (3)
Providers\ServiceIndexResourceV3Provider.cs (1)
175
ex.InnerException.InnerException is System.Net.Sockets.
SocketException
)
RemoteRepositories\HttpFileSystemBasedFindPackageByIdResource.cs (1)
557
ex.InnerException.InnerException is System.Net.Sockets.
SocketException
)
Utility\FindPackagesByIdNupkgDownloader.cs (1)
307
ex.InnerException.InnerException is System.Net.Sockets.
SocketException
)
System (1)
src\runtime\src\libraries\shims\System\ref\System.cs (1)
762
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Net.Sockets.
SocketException
))]
System.IO.Pipes (7)
System\IO\Pipes\NamedPipeClientStream.Unix.cs (1)
46
catch (
SocketException
e)
System\IO\Pipes\NamedPipeServerStream.Unix.cs (1)
349
catch (
SocketException
) when (isFirstPipeInstance && !isSocketBound)
System\IO\Pipes\PipeStream.Unix.cs (5)
274
catch (
SocketException
e)
297
catch (
SocketException
e)
309
catch (
SocketException
e)
326
catch (
SocketException
e)
332
private IOException GetIOExceptionForSocketException(
SocketException
e)
System.Net (1)
System.Net.cs (1)
43
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Net.Sockets.
SocketException
))]
System.Net.Http (2)
System\Net\Http\SocketsHttpHandler\ConnectHelper.cs (1)
156
if (exception is
SocketException
socketException &&
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (1)
153
catch (Exception e) when (e is
SocketException
|| e is ObjectDisposedException)
System.Net.HttpListener (3)
System\Net\Managed\HttpEndPointManager.cs (1)
159
catch (
SocketException
ex)
System\Net\ServiceNameStore.cs (2)
284
catch (System.Net.Sockets.
SocketException
)
302
catch (System.Net.Sockets.
SocketException
)
System.Net.NameResolution (12)
System\Net\Dns.cs (11)
135
if (ex is
SocketException
soex)
331
catch (
SocketException
ex)
361
catch (
SocketException
ex)
474
private static bool TryHandleRfc6761InvalidDomain(string hostName, out
SocketException
? exception)
502
if (TryHandleRfc6761InvalidDomain(hostName, out
SocketException
? invalidDomainException))
561
catch (
SocketException
ex) when (addressFamily == AddressFamily.InterNetworkV6 && ex.SocketErrorCode == SocketError.HostNotFound)
707
if (TryHandleRfc6761InvalidDomain(hostName, out
SocketException
? invalidDomainException))
825
catch (
SocketException
ex) when (isLocalhostSubdomain && !fallbackOccurred)
858
catch (
SocketException
ex) when (family == AddressFamily.InterNetworkV6 && ex.SocketErrorCode == SocketError.HostNotFound)
871
catch (
SocketException
ex) when (family == AddressFamily.InterNetworkV6 && ex.SocketErrorCode == SocketError.HostNotFound)
983
private static
SocketException
CreateException(SocketError error, int nativeError) =>
System\Net\NameResolutionTelemetry.cs (1)
145
internal static string GetErrorType(Exception exception) => (exception as
SocketException
)?.SocketErrorCode switch
System.Net.NetworkInformation (1)
System\Net\NetworkInformation\NetworkAddressChange.Unix.cs (1)
208
catch (
SocketException
se) when (se.SocketErrorCode == SocketError.OperationAborted)
System.Net.Ping (6)
System\Net\NetworkInformation\Ping.RawSocket.cs (6)
281
catch (
SocketException
ex) when (ex.SocketErrorCode == SocketError.TimedOut)
284
catch (
SocketException
ex) when (ex.SocketErrorCode == SocketError.MessageSize)
288
catch (
SocketException
ex) when (ex.SocketErrorCode == SocketError.HostUnreachable)
366
catch (
SocketException
ex) when (ex.SocketErrorCode == SocketError.TimedOut)
369
catch (
SocketException
ex) when (ex.SocketErrorCode == SocketError.MessageSize)
376
catch (
SocketException
ex) when (ex.SocketErrorCode == SocketError.HostUnreachable)
System.Net.Primitives (5)
System\Net\SocketException.cs (4)
18
/// <summary>Creates a new instance of the <see cref='System.Net.Sockets.
SocketException
'/> class with the specified error code.</summary>
33
/// <summary>Initializes a new instance of the <see cref='System.Net.Sockets.
SocketException
'/> class with the specified error code and optional message.</summary>
38
/// <summary>Creates a new instance of the <see cref='System.Net.Sockets.
SocketException
'/> class with the specified error code as SocketError.</summary>
44
/// <summary>Initializes a new instance of the <see cref='System.Net.Sockets.
SocketException
'/> class with the specified error code as SocketError and optional message.</summary>
System\Net\SocketException.Unix.cs (1)
10
/// <summary>Creates a new instance of the <see cref='System.Net.Sockets.
SocketException
'/> class with the default error code.</summary>
System.Net.Requests (5)
System\Net\FtpWebRequest.cs (3)
917
ioEx.InnerException is
SocketException
sEx &&
935
if (e is
SocketException
se)
1005
if (!(exception is
SocketException
|| exception is ObjectDisposedException) || !timer.HasExpired)
System\Net\WebException.cs (2)
105
SocketException
? socketException = ex.InnerException as
SocketException
;
System.Net.Sockets (39)
src\runtime\src\libraries\Common\src\System\Net\Sockets\SocketExceptionFactory.Unix.cs (1)
8
public static
SocketException
CreateSocketException(int socketError, EndPoint endPoint)
System\Net\Sockets\Socket.cs (22)
107
/// <exception cref="
SocketException
"><paramref name="handle"/> is not a socket or information about the socket could not be accessed.</exception>
1293
/// <exception cref="
SocketException
">An error occurred when attempting to access the socket.</exception>
1321
/// <exception cref="
SocketException
">An error occurred when attempting to access the socket.</exception>
1414
/// <exception cref="
SocketException
">An error occurred when attempting to access the socket.</exception>
1431
/// <exception cref="
SocketException
">An error occurred when attempting to access the socket.</exception>
1474
/// <exception cref="
SocketException
">An error occurred when attempting to access the socket.</exception>
1837
SocketException
? socketException = null;
1920
/// <exception cref="
SocketException
">An error occurred when attempting to access the socket.</exception>
1935
/// <exception cref="
SocketException
">An error occurred when attempting to access the socket.</exception>
1961
SocketException
? socketException = null;
2018
/// <exception cref="
SocketException
">An error occurred when attempting to access the socket.</exception>
2040
SocketException
socketException = new SocketException((int)errorCode);
2168
/// <exception cref="
SocketException
">An error occurred when attempting to access the socket.</exception>
2288
/// <exception cref="
SocketException
">An error occurred when attempting to access the socket.</exception>
2346
/// <exception cref="
SocketException
">An error occurred when attempting to access the socket.</exception>
2381
/// <exception cref="
SocketException
">An error occurred when attempting to access the socket.</exception>
2393
/// <exception cref="
SocketException
">An error occurred when attempting to access the socket.</exception>
2436
/// <exception cref="
SocketException
">An error occurred when attempting to access the socket.</exception>
3383
SocketException
socketException = SocketExceptionFactory.CreateSocketException((int)errorCode, endPointSnapshot);
3924
var
socketException = new SocketException((int)error);
3933
internal void UpdateStatusAfterSocketError(
SocketException
socketException, bool disconnectOnFailure = true)
4083
SocketException
se => se.SocketErrorCode,
System\Net\Sockets\Socket.Tasks.cs (2)
710
/// <exception cref="
SocketException
">An error occurred when attempting to access the socket.</exception>
728
/// <exception cref="
SocketException
">An error occurred when attempting to access the socket.</exception>
System\Net\Sockets\Socket.Unix.cs (1)
284
catch (TargetInvocationException ex) when (ex.InnerException is
SocketException
se && se.SocketErrorCode == SocketError.OperationNotSupported)
System\Net\Sockets\SocketAsyncEventArgs.cs (3)
451
SocketException
? socketException = exception as
SocketException
;
879
(caughtException is
SocketException
se && se.SocketErrorCode == SocketError.OperationAborted))
System\Net\Sockets\SocketPal.Unix.cs (1)
2146
exc is
SocketException
se ? se.SocketErrorCode :
System\Net\Sockets\TCPListener.cs (2)
149
catch (
SocketException
)
296
catch (
SocketException
) when (!_active)
System\Net\Sockets\UDPClient.cs (7)
543
/// <exception cref="
SocketException
">An error occurred when accessing the socket.</exception>
568
/// <exception cref="
SocketException
">An error occurred when accessing the socket.</exception>
602
/// <exception cref="
SocketException
">An error occurred when accessing the socket.</exception>
645
/// <exception cref="
SocketException
">An error occurred when accessing the socket.</exception>
894
/// <exception cref="
SocketException
">An error occurred when accessing the socket.</exception>
935
/// <exception cref="
SocketException
">An error occurred when accessing the socket.</exception>
964
/// <exception cref="
SocketException
">An error occurred when accessing the socket.</exception>
System.ServiceModel.Http (2)
System\ServiceModel\Channels\HttpChannelHelpers.cs (2)
122
var
innerSocketException = exception.InnerException as
SocketException
;
System.ServiceModel.NetTcp (15)
System\ServiceModel\Channels\DnsCache.cs (3)
42
catch (
SocketException
)
84
SocketException
dnsException = null;
89
catch (
SocketException
e)
System\ServiceModel\Channels\SocketAwaitableEventArgs.cs (1)
101
protected static
SocketException
CreateException(SocketError e)
System\ServiceModel\Channels\SocketConnection.cs (11)
219
catch (
SocketException
socketException)
301
catch (
SocketException
socketException)
410
catch (
SocketException
socketException)
669
private Exception ConvertSendException(
SocketException
socketException, TimeSpan remainingTime, TimeSpan timeout)
675
private Exception ConvertReceiveException(
SocketException
socketException, TimeSpan remainingTime, TimeSpan timeout)
681
private static Exception ConvertTransferException(
SocketException
socketException, TimeSpan timeout, Exception originalException,
825
public static Exception ConvertConnectException(
SocketException
socketException, Uri remoteUri, TimeSpan timeSpent, Exception innerException)
899
catch (
SocketException
socketException)
915
SocketException
innerException)
942
SocketException
lastException = null;
965
catch (
SocketException
socketException)
System.ServiceModel.UnixDomainSocket (11)
System\ServiceModel\Channels\SocketAwaitableEventArgs.cs (1)
101
protected static
SocketException
CreateException(SocketError e)
System\ServiceModel\Channels\SocketConnection.cs (10)
201
catch (
SocketException
socketException)
280
catch (
SocketException
socketException)
389
catch (
SocketException
socketException)
633
private Exception ConvertSendException(
SocketException
socketException, TimeSpan remainingTime, TimeSpan timeout)
639
private Exception ConvertReceiveException(
SocketException
socketException, TimeSpan remainingTime, TimeSpan timeout)
645
private static Exception ConvertTransferException(
SocketException
socketException, TimeSpan timeout, Exception originalException,
790
public static Exception ConvertConnectException(
SocketException
socketException, Uri remoteUri, TimeSpan timeSpent, Exception innerException)
837
private static TimeoutException CreateTimeoutException(Uri uri, TimeSpan timeout,
SocketException
innerException)
845
SocketException
lastException = null;
858
catch (
SocketException
socketException)