83 references to SocketErrorCode
ClientSample (6)
Tcp\TcpConnection.cs (6)
116
catch (SocketException ex) when (ex.
SocketErrorCode
== SocketError.ConnectionReset)
120
catch (SocketException ex) when (ex.
SocketErrorCode
== SocketError.OperationAborted ||
121
ex.
SocketErrorCode
== SocketError.ConnectionAborted ||
122
ex.
SocketErrorCode
== SocketError.Interrupted ||
123
ex.
SocketErrorCode
== SocketError.InvalidArgument)
191
catch (SocketException ex) when (ex.
SocketErrorCode
== SocketError.OperationAborted)
dotnet-svcutil-lib (24)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\SocketConnection.cs (24)
208
if ((int)socketException.
SocketErrorCode
== UnsafeNativeMethods.ERROR_INVALID_HANDLE)
219
if ((int)socketException.
SocketErrorCode
== UnsafeNativeMethods.WSAECONNABORTED &&
226
if ((int)socketException.
SocketErrorCode
== UnsafeNativeMethods.WSAENETRESET ||
227
(int)socketException.
SocketErrorCode
== UnsafeNativeMethods.WSAECONNABORTED ||
228
(int)socketException.
SocketErrorCode
== UnsafeNativeMethods.WSAECONNRESET)
240
else if ((int)socketException.
SocketErrorCode
== UnsafeNativeMethods.WSAETIMEDOUT)
249
return new CommunicationObjectAbortedException(string.Format(SRServiceModel.TcpTransferError, (int)socketException.
SocketErrorCode
, socketException.Message), originalException);
253
CommunicationException communicationException = new CommunicationException(string.Format(SRServiceModel.TcpTransferError, (int)socketException.
SocketErrorCode
, socketException.Message), originalException);
437
if ((int)socketException.
SocketErrorCode
== UnsafeNativeMethods.ERROR_INVALID_HANDLE)
442
if ((int)socketException.
SocketErrorCode
== UnsafeNativeMethods.WSAEADDRNOTAVAIL ||
443
(int)socketException.
SocketErrorCode
== UnsafeNativeMethods.WSAECONNREFUSED ||
444
(int)socketException.
SocketErrorCode
== UnsafeNativeMethods.WSAENETDOWN ||
445
(int)socketException.
SocketErrorCode
== UnsafeNativeMethods.WSAENETUNREACH ||
446
(int)socketException.
SocketErrorCode
== UnsafeNativeMethods.WSAEHOSTDOWN ||
447
(int)socketException.
SocketErrorCode
== UnsafeNativeMethods.WSAEHOSTUNREACH ||
448
(int)socketException.
SocketErrorCode
== UnsafeNativeMethods.WSAETIMEDOUT)
452
return new EndpointNotFoundException(string.Format(SRServiceModel.TcpConnectError, remoteUri.AbsoluteUri, (int)socketException.
SocketErrorCode
, socketException.Message), innerException);
456
return new EndpointNotFoundException(string.Format(SRServiceModel.TcpConnectErrorWithTimeSpan, remoteUri.AbsoluteUri, (int)socketException.
SocketErrorCode
, socketException.Message, timeSpent), innerException);
459
else if ((int)socketException.
SocketErrorCode
== UnsafeNativeMethods.WSAENOBUFS)
463
else if ((int)socketException.
SocketErrorCode
== UnsafeNativeMethods.ERROR_NOT_ENOUGH_MEMORY ||
464
(int)socketException.
SocketErrorCode
== UnsafeNativeMethods.ERROR_NO_SYSTEM_RESOURCES ||
465
(int)socketException.
SocketErrorCode
== UnsafeNativeMethods.ERROR_OUTOFMEMORY)
473
return new CommunicationException(string.Format(SRServiceModel.TcpConnectError, remoteUri.AbsoluteUri, (int)socketException.
SocketErrorCode
, socketException.Message), innerException);
477
return new CommunicationException(string.Format(SRServiceModel.TcpConnectErrorWithTimeSpan, remoteUri.AbsoluteUri, (int)socketException.
SocketErrorCode
, socketException.Message, timeSpent), innerException);
HttpStress (1)
Program.cs (1)
597
if (e is HttpRequestException hre && hre.InnerException is SocketException se && se.
SocketErrorCode
== SocketError.AddressAlreadyInUse)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (1)
Internal\QuicConnectionListener.cs (1)
134
catch (SocketException e) when (e.
SocketErrorCode
== SocketError.AddressAlreadyInUse)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (6)
Internal\SocketConnection.cs (4)
209
if (IsConnectionResetError(result.SocketError.
SocketErrorCode
))
219
if (IsConnectionAbortError(result.SocketError.
SocketErrorCode
))
289
if (IsConnectionResetError(transferResult.SocketError.
SocketErrorCode
))
298
if (IsConnectionAbortError(transferResult.SocketError.
SocketErrorCode
))
SocketConnectionListener.cs (2)
46
catch (SocketException e) when (e.
SocketErrorCode
== SocketError.AddressAlreadyInUse)
82
catch (SocketException e) when (e.
SocketErrorCode
== SocketError.OperationAborted)
Microsoft.Extensions.Diagnostics.ExceptionSummarization (1)
HttpExceptionSummaryProvider.cs (1)
106
if (_socketErrorMap.TryGetValue(ex.
SocketErrorCode
, out var index))
Microsoft.Extensions.Diagnostics.Probes.Tests (1)
TcpEndpointProbesServiceTests.cs (1)
109
if (e.
SocketErrorCode
== SocketError.ConnectionRefused)
Sockets.BindTests (2)
src\Servers\Kestrel\shared\test\TransportTestHelpers\HostNameIsReachableAttribute.cs (2)
48
ex.
SocketErrorCode
== SocketError.NetworkUnreachable
49
|| ex.
SocketErrorCode
== SocketError.HostNotFound)
Sockets.FunctionalTests (2)
src\Servers\Kestrel\shared\test\TransportTestHelpers\HostNameIsReachableAttribute.cs (2)
48
ex.
SocketErrorCode
== SocketError.NetworkUnreachable
49
|| ex.
SocketErrorCode
== SocketError.HostNotFound)
System.IO.Pipes (2)
System\IO\Pipes\NamedPipeClientStream.Unix.cs (1)
51
switch (e.
SocketErrorCode
)
System\IO\Pipes\PipeStream.Unix.cs (1)
334
if (e.
SocketErrorCode
== SocketError.Shutdown) // EPIPE
System.Net.Http (1)
System\Net\Http\SocketsHttpHandler\ConnectHelper.cs (1)
157
socketException.
SocketErrorCode
is SocketError.HostNotFound or SocketError.TryAgain)
System.Net.NameResolution (1)
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)
206
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.Requests (3)
System\Net\FtpWebRequest.cs (2)
920
sEx.
SocketErrorCode
== SocketError.TimedOut)
939
if (se.
SocketErrorCode
== SocketError.HostNotFound)
System\Net\WebException.cs (1)
113
switch (socketException.
SocketErrorCode
)
System.Net.Sockets (9)
System\Net\Sockets\Socket.cs (4)
1839
if (socketException.
SocketErrorCode
!= SocketError.MessageSize)
1963
if (socketException.
SocketErrorCode
!= SocketError.MessageSize)
3922
UpdateStatusAfterSocketError(socketException.
SocketErrorCode
, disconnectOnFailure);
4070
SocketException se => se.
SocketErrorCode
,
System\Net\Sockets\Socket.Tasks.cs (1)
121
catch (SocketException se) when (se.
SocketErrorCode
== SocketError.OperationAborted)
System\Net\Sockets\Socket.Unix.cs (1)
306
catch (TargetInvocationException ex) when (ex.InnerException is SocketException se && se.
SocketErrorCode
== SocketError.OperationNotSupported)
System\Net\Sockets\SocketAsyncEventArgs.cs (2)
454
_socketError = socketException.
SocketErrorCode
;
827
(caughtException is SocketException se && se.
SocketErrorCode
== SocketError.OperationAborted))
System\Net\Sockets\SocketPal.Unix.cs (1)
2146
exc is SocketException se ? se.
SocketErrorCode
:
System.ServiceModel.UnixDomainSocket (16)
System\ServiceModel\Channels\SocketConnection.cs (16)
792
if ((int)socketException.
SocketErrorCode
== UnsafeNativeMethods.ERROR_INVALID_HANDLE)
797
if ((int)socketException.
SocketErrorCode
== UnsafeNativeMethods.WSAEADDRNOTAVAIL ||
798
(int)socketException.
SocketErrorCode
== UnsafeNativeMethods.WSAECONNREFUSED ||
799
(int)socketException.
SocketErrorCode
== UnsafeNativeMethods.WSAENETDOWN ||
800
(int)socketException.
SocketErrorCode
== UnsafeNativeMethods.WSAENETUNREACH ||
801
(int)socketException.
SocketErrorCode
== UnsafeNativeMethods.WSAEHOSTDOWN ||
802
(int)socketException.
SocketErrorCode
== UnsafeNativeMethods.WSAEHOSTUNREACH ||
803
(int)socketException.
SocketErrorCode
== UnsafeNativeMethods.WSAETIMEDOUT)
807
return new EndpointNotFoundException(SR.Format(SR.UDSConnectError, remoteUri.AbsoluteUri, (int)socketException.
SocketErrorCode
, socketException.Message), innerException);
811
return new EndpointNotFoundException(SR.Format(SR.UDSConnectErrorWithTimeSpan, remoteUri.AbsoluteUri, (int)socketException.
SocketErrorCode
, socketException.Message, timeSpent), innerException);
814
else if ((int)socketException.
SocketErrorCode
== UnsafeNativeMethods.WSAENOBUFS)
818
else if ((int)socketException.
SocketErrorCode
== UnsafeNativeMethods.ERROR_NOT_ENOUGH_MEMORY ||
819
(int)socketException.
SocketErrorCode
== UnsafeNativeMethods.ERROR_NO_SYSTEM_RESOURCES ||
820
(int)socketException.
SocketErrorCode
== UnsafeNativeMethods.ERROR_OUTOFMEMORY)
828
return new CommunicationException(SR.Format(SR.UDSConnectError, remoteUri.AbsoluteUri, (int)socketException.
SocketErrorCode
, socketException.Message), innerException);
832
return new CommunicationException(SR.Format(SR.UDSConnectErrorWithTimeSpan, remoteUri.AbsoluteUri, (int)socketException.
SocketErrorCode
, socketException.Message, timeSpent), innerException);