1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
4 
5 using System;
6 using System.Net;
7 
8 namespace System.Net.Sockets
9 {
10     public enum SocketError : int
11     {
12         Success = 0,
13         SocketError = (-1),
14         Interrupted = (10000 + 4),
15         AccessDenied = (10000 + 13),
16         Fault = (10000 + 14),
17         InvalidArgument = (10000 + 22),
18         TooManyOpenSockets = (10000 + 24),
19 
20         // Windows Sockets definitions of regular Berkeley error constants
21         WouldBlock = (10000 + 35),
22         InProgress = (10000 + 36),
23         AlreadyInProgress = (10000 + 37),
24         NotSocket = (10000 + 38),
25         DestinationAddressRequired = (10000 + 39),
26         MessageSize = (10000 + 40),
27         ProtocolType = (10000 + 41),
28         ProtocolOption = (10000 + 42),
29         ProtocolNotSupported = (10000 + 43),
30         SocketNotSupported = (10000 + 44),
31         OperationNotSupported = (10000 + 45),
32         ProtocolFamilyNotSupported = (10000 + 46),
33         AddressFamilyNotSupported = (10000 + 47),
34         AddressAlreadyInUse = (10000 + 48),
35         AddressNotAvailable = (10000 + 49),
36         NetworkDown = (10000 + 50),
37         NetworkUnreachable = (10000 + 51),
38         NetworkReset = (10000 + 52),
39         ConnectionAborted = (10000 + 53),
40         ConnectionReset = (10000 + 54),
41         NoBufferSpaceAvailable = (10000 + 55),
42         IsConnected = (10000 + 56),
43         NotConnected = (10000 + 57),
44         Shutdown = (10000 + 58),
45         TimedOut = (10000 + 60),
46         ConnectionRefused = (10000 + 61),
47         HostDown = (10000 + 64),
48         HostUnreachable = (10000 + 65),
49         ProcessLimit = (10000 + 67),
50 
51         // Extended Windows Sockets error constant definitions
52         SystemNotReady = (10000 + 91),
53         VersionNotSupported = (10000 + 92),
54         NotInitialized = (10000 + 93),
55         Disconnecting = (10000 + 101),
56         TypeNotFound = (10000 + 109),
57         HostNotFound = (10000 + 1001),
58         TryAgain = (10000 + 1002),
59         NoRecovery = (10000 + 1003),
60         NoData = (10000 + 1004),
61 
62         // OS dependent errors
63         IOPending = (int)Interop.Winsock.ERROR_IO_PENDING,
64         OperationAborted = (int)Interop.Winsock.ERROR_OPERATION_ABORTED,
65     }
66 }
67