126 references to Error
System.Net.Primitives (126)
LibraryImports.g.cs (3)
7
internal static extern partial global::Interop.
Error
ConvertErrorPlatformToPal(int platformErrno);
15
internal static extern partial int ConvertErrorPalToPlatform(global::Interop.
Error
error);
283
internal static unsafe extern partial global::Interop.
Error
Poll(global::Interop.PollEvent* pollEvents, uint eventCount, int timeout, uint* triggered);
src\libraries\Common\src\Interop\Unix\Interop.Errors.cs (7)
119
private readonly
Error
_error;
128
internal ErrorInfo(
Error
error)
134
internal
Error
Error
157
internal static
Error
GetLastError()
198
internal static partial
Error
ConvertErrorPlatformToPal(int platformErrno);
202
internal static partial int ConvertErrorPalToPlatform(
Error
error);
220
public static Interop.ErrorInfo Info(this Interop.
Error
error)
src\libraries\Common\src\Interop\Unix\System.Native\Interop.SocketAddress.cs (9)
14
internal static unsafe partial
Error
GetSocketAddressSizes(int* ipv4SocketAddressSize, int* ipv6SocketAddressSize, int* udsSocketAddressSize, int* maxSocketAddressSize);
18
internal static unsafe partial
Error
GetAddressFamily(byte* socketAddress, int socketAddressLen, int* addressFamily);
22
internal static unsafe partial
Error
SetAddressFamily(byte* socketAddress, int socketAddressLen, int addressFamily);
26
internal static unsafe partial
Error
GetPort(byte* socketAddress, int socketAddressLen, ushort* port);
30
internal static unsafe partial
Error
SetPort(byte* socketAddress, int socketAddressLen, ushort port);
34
internal static unsafe partial
Error
GetIPv4Address(byte* socketAddress, int socketAddressLen, uint* address);
38
internal static unsafe partial
Error
SetIPv4Address(byte* socketAddress, int socketAddressLen, uint address);
41
internal static unsafe partial
Error
GetIPv6Address(byte* socketAddress, int socketAddressLen, byte* address, int addressLen, uint* scopeId);
44
internal static unsafe partial
Error
SetIPv6Address(byte* socketAddress, int socketAddressLen, byte* address, int addressLen, uint scopeId);
src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (14)
26
Interop.
Error
err = Interop.Sys.GetSocketAddressSizes(&ipv4, &ipv6, &uds, &max);
27
Debug.Assert(err == Interop.
Error
.SUCCESS, $"Unexpected err: {err}");
39
private static void ThrowOnFailure(Interop.
Error
err)
43
case Interop.
Error
.SUCCESS:
46
case Interop.
Error
.EFAULT:
50
case Interop.
Error
.EAFNOSUPPORT:
63
Interop.
Error
err;
75
Interop.
Error
err;
91
Interop.
Error
err;
103
Interop.
Error
err;
115
Interop.
Error
err;
128
Interop.
Error
err;
141
Interop.
Error
err;
167
Interop.
Error
err;
src\libraries\Common\src\System\Net\Sockets\SocketErrorPal.Unix.cs (92)
20
internal static SocketError GetSocketErrorForNativeError(Interop.
Error
errno) => errno switch
22
Interop.
Error
.EACCES => SocketError.AccessDenied,
23
Interop.
Error
.EADDRINUSE => SocketError.AddressAlreadyInUse,
24
Interop.
Error
.EADDRNOTAVAIL => SocketError.AddressNotAvailable,
25
Interop.
Error
.EAFNOSUPPORT => SocketError.AddressFamilyNotSupported,
26
Interop.
Error
.EAGAIN => SocketError.WouldBlock,
27
Interop.
Error
.EALREADY => SocketError.AlreadyInProgress,
28
Interop.
Error
.EBADF => SocketError.OperationAborted,
29
Interop.
Error
.ECANCELED => SocketError.OperationAborted,
30
Interop.
Error
.ECONNABORTED => SocketError.ConnectionAborted,
31
Interop.
Error
.ECONNREFUSED => SocketError.ConnectionRefused,
32
Interop.
Error
.ECONNRESET => SocketError.ConnectionReset,
33
Interop.
Error
.EDESTADDRREQ => SocketError.DestinationAddressRequired,
34
Interop.
Error
.EFAULT => SocketError.Fault,
35
Interop.
Error
.EHOSTDOWN => SocketError.HostDown,
36
Interop.
Error
.ENXIO => SocketError.HostNotFound, // not perfect, but closest match available
37
Interop.
Error
.EHOSTUNREACH => SocketError.HostUnreachable,
38
Interop.
Error
.EINPROGRESS => SocketError.InProgress,
39
Interop.
Error
.EINTR => SocketError.Interrupted,
40
Interop.
Error
.EINVAL => SocketError.InvalidArgument,
41
Interop.
Error
.EISCONN => SocketError.IsConnected,
42
Interop.
Error
.EMFILE => SocketError.TooManyOpenSockets,
43
Interop.
Error
.EMSGSIZE => SocketError.MessageSize,
44
Interop.
Error
.ENETDOWN => SocketError.NetworkDown,
45
Interop.
Error
.ENETRESET => SocketError.NetworkReset,
46
Interop.
Error
.ENETUNREACH => SocketError.NetworkUnreachable,
47
Interop.
Error
.ENFILE => SocketError.TooManyOpenSockets,
48
Interop.
Error
.ENOBUFS => SocketError.NoBufferSpaceAvailable,
49
Interop.
Error
.ENODATA => SocketError.NoData,
50
Interop.
Error
.ENOENT => SocketError.AddressNotAvailable,
51
Interop.
Error
.ENOPROTOOPT => SocketError.ProtocolOption,
52
Interop.
Error
.ENOTCONN => SocketError.NotConnected,
53
Interop.
Error
.ENOTSOCK => SocketError.NotSocket,
54
Interop.
Error
.ENOTSUP => SocketError.OperationNotSupported,
55
Interop.
Error
.EPERM => SocketError.AccessDenied,
56
Interop.
Error
.EPIPE => SocketError.Shutdown,
57
Interop.
Error
.EPFNOSUPPORT => SocketError.ProtocolFamilyNotSupported,
58
Interop.
Error
.EPROTONOSUPPORT => SocketError.ProtocolNotSupported,
59
Interop.
Error
.EPROTOTYPE => SocketError.ProtocolType,
60
Interop.
Error
.ESOCKTNOSUPPORT => SocketError.SocketNotSupported,
61
Interop.
Error
.ESHUTDOWN => SocketError.Disconnecting,
62
Interop.
Error
.SUCCESS => SocketError.Success,
63
Interop.
Error
.ETIMEDOUT => SocketError.TimedOut,
67
private static Interop.
Error
GetNativeErrorForSocketErrorHelper(SocketError error) => error switch
75
SocketError.AccessDenied => Interop.
Error
.EACCES, // could also have been EPERM
76
SocketError.AddressAlreadyInUse => Interop.
Error
.EADDRINUSE,
77
SocketError.AddressNotAvailable => Interop.
Error
.EADDRNOTAVAIL,
78
SocketError.AddressFamilyNotSupported => Interop.
Error
.EAFNOSUPPORT,
79
SocketError.AlreadyInProgress => Interop.
Error
.EALREADY,
80
SocketError.ConnectionAborted => Interop.
Error
.ECONNABORTED,
81
SocketError.ConnectionRefused => Interop.
Error
.ECONNREFUSED,
82
SocketError.ConnectionReset => Interop.
Error
.ECONNRESET,
83
SocketError.DestinationAddressRequired => Interop.
Error
.EDESTADDRREQ,
84
SocketError.Disconnecting => Interop.
Error
.ESHUTDOWN,
85
SocketError.Fault => Interop.
Error
.EFAULT,
86
SocketError.HostDown => Interop.
Error
.EHOSTDOWN,
87
SocketError.HostNotFound => Interop.
Error
.EHOSTNOTFOUND,
88
SocketError.HostUnreachable => Interop.
Error
.EHOSTUNREACH,
89
SocketError.InProgress => Interop.
Error
.EINPROGRESS,
90
SocketError.Interrupted => Interop.
Error
.EINTR,
91
SocketError.InvalidArgument => Interop.
Error
.EINVAL,
92
SocketError.IOPending => Interop.
Error
.EINPROGRESS,
93
SocketError.IsConnected => Interop.
Error
.EISCONN,
94
SocketError.MessageSize => Interop.
Error
.EMSGSIZE,
95
SocketError.NetworkDown => Interop.
Error
.ENETDOWN,
96
SocketError.NetworkReset => Interop.
Error
.ENETRESET,
97
SocketError.NetworkUnreachable => Interop.
Error
.ENETUNREACH,
98
SocketError.NoBufferSpaceAvailable => Interop.
Error
.ENOBUFS,
99
SocketError.NoData => Interop.
Error
.ENODATA,
100
SocketError.NotConnected => Interop.
Error
.ENOTCONN,
101
SocketError.NotSocket => Interop.
Error
.ENOTSOCK,
102
SocketError.OperationAborted => Interop.
Error
.ECANCELED,
103
SocketError.OperationNotSupported => Interop.
Error
.ENOTSUP,
104
SocketError.ProtocolFamilyNotSupported => Interop.
Error
.EPFNOSUPPORT,
105
SocketError.ProtocolNotSupported => Interop.
Error
.EPROTONOSUPPORT,
106
SocketError.ProtocolOption => Interop.
Error
.ENOPROTOOPT,
107
SocketError.ProtocolType => Interop.
Error
.EPROTOTYPE,
108
SocketError.Shutdown => Interop.
Error
.EPIPE,
109
SocketError.SocketNotSupported => Interop.
Error
.ESOCKTNOSUPPORT,
110
SocketError.Success => Interop.
Error
.SUCCESS,
111
SocketError.TimedOut => Interop.
Error
.ETIMEDOUT,
112
SocketError.TooManyOpenSockets => Interop.
Error
.ENFILE, // could also have been EMFILE
113
SocketError.TryAgain => Interop.
Error
.EAGAIN, // not a perfect mapping, but better than nothing
114
SocketError.WouldBlock => Interop.
Error
.EAGAIN,
115
SocketError.SocketError => Interop.
Error
.ESOCKETERROR,
116
_ => Interop.
Error
.SUCCESS, // default for unknown mappings
119
internal static Interop.
Error
GetNativeErrorForSocketError(SocketError error)
121
Interop.
Error
errno = GetNativeErrorForSocketErrorHelper(error);
122
if (errno == Interop.
Error
.SUCCESS)
125
errno = (Interop.
Error
)(int)error;
130
internal static bool TryGetNativeErrorForSocketError(SocketError error, out Interop.
Error
errno)
133
return errno != Interop.
Error
.SUCCESS;
System\Net\SocketException.Unix.cs (1)
29
if (SocketErrorPal.TryGetNativeErrorForSocketError(error, out Interop.
Error
interopErr))