-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathSocketError.cs
More file actions
311 lines (304 loc) · 10 KB
/
Copy pathSocketError.cs
File metadata and controls
311 lines (304 loc) · 10 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
/* NOTE: these values and descriptions are copied from the .NET Micro Framework source (Apache 2.0 license). Copyright (c) Microsoft. */
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) Microsoft Corporation. All rights reserved.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
using System;
namespace Netduino.IP
{
public enum SocketError : int
{
/// <devdoc>
/// <para>
/// The operation completed succesfully.
/// </para>
/// </devdoc>
Success = 0,
/// <devdoc>
/// <para>
/// The socket has an error.
/// </para>
/// </devdoc>
SocketError = (-1),
/*
* Windows Sockets definitions of regular Microsoft C error constants
*/
/// <devdoc>
/// <para>
/// A blocking socket call was canceled.
/// </para>
/// </devdoc>
Interrupted = (10000 + 4), //WSAEINTR
/// <devdoc>
/// <para>
/// [To be supplied.]
/// </para>
/// </devdoc>
//WSAEBADF = (10000+9), //
/// <devdoc>
/// <para>
/// Permission denied.
/// </para>
/// </devdoc>
AccessDenied = (10000 + 13), //WSAEACCES
/// <devdoc>
/// <para>
/// Bad address.
/// </para>
/// </devdoc>
Fault = (10000 + 14), //WSAEFAULT
/// <devdoc>
/// <para>
/// Invalid argument.
/// </para>
/// </devdoc>
InvalidArgument = (10000 + 22), //WSAEINVAL
/// <devdoc>
/// <para>
/// Too many open
/// files.
/// </para>
/// </devdoc>
TooManyOpenSockets = (10000 + 24), //WSAEMFILE
/*
* Windows Sockets definitions of regular Berkeley error constants
*/
/// <devdoc>
/// <para>
/// Resource temporarily unavailable.
/// </para>
/// </devdoc>
WouldBlock = (10000 + 35), //WSAEWOULDBLOCK
/// <devdoc>
/// <para>
/// Operation now in progress.
/// </para>
/// </devdoc>
InProgress = (10000 + 36), // WSAEINPROGRESS
/// <devdoc>
/// <para>
/// Operation already in progress.
/// </para>
/// </devdoc>
AlreadyInProgress = (10000 + 37), //WSAEALREADY
/// <devdoc>
/// <para>
/// Socket operation on nonsocket.
/// </para>
/// </devdoc>
NotSocket = (10000 + 38), //WSAENOTSOCK
/// <devdoc>
/// <para>
/// Destination address required.
/// </para>
/// </devdoc>
DestinationAddressRequired = (10000 + 39), //WSAEDESTADDRREQ
/// <devdoc>
/// <para>
/// Message too long.
/// </para>
/// </devdoc>
MessageSize = (10000 + 40), //WSAEMSGSIZE
/// <devdoc>
/// <para>
/// Protocol wrong type for socket.
/// </para>
/// </devdoc>
ProtocolType = (10000 + 41), //WSAEPROTOTYPE
/// <devdoc>
/// <para>
/// Bad protocol option.
/// </para>
/// </devdoc>
ProtocolOption = (10000 + 42), //WSAENOPROTOOPT
/// <devdoc>
/// <para>
/// Protocol not supported.
/// </para>
/// </devdoc>
ProtocolNotSupported = (10000 + 43), //WSAEPROTONOSUPPORT
/// <devdoc>
/// <para>
/// Socket type not supported.
/// </para>
/// </devdoc>
SocketNotSupported = (10000 + 44), //WSAESOCKTNOSUPPORT
/// <devdoc>
/// <para>
/// Operation not supported.
/// </para>
/// </devdoc>
OperationNotSupported = (10000 + 45), //WSAEOPNOTSUPP
/// <devdoc>
/// <para>
/// Protocol family not supported.
/// </para>
/// </devdoc>
ProtocolFamilyNotSupported = (10000 + 46), //WSAEPFNOSUPPORT
/// <devdoc>
/// <para>
/// Address family not supported by protocol family.
/// </para>
/// </devdoc>
AddressFamilyNotSupported = (10000 + 47), //WSAEAFNOSUPPORT
/// <devdoc>
/// Address already in use.
/// </devdoc>
AddressAlreadyInUse = (10000 + 48), // WSAEADDRINUSE
/// <devdoc>
/// <para>
/// Cannot assign requested address.
/// </para>
/// </devdoc>
AddressNotAvailable = (10000 + 49), //WSAEADDRNOTAVAIL
/// <devdoc>
/// <para>
/// Network is down.
/// </para>
/// </devdoc>
NetworkDown = (10000 + 50), //WSAENETDOWN
/// <devdoc>
/// <para>
/// Network is unreachable.
/// </para>
/// </devdoc>
NetworkUnreachable = (10000 + 51), //WSAENETUNREACH
/// <devdoc>
/// <para>
/// Network dropped connection on reset.
/// </para>
/// </devdoc>
NetworkReset = (10000 + 52), //WSAENETRESET
/// <devdoc>
/// <para>
/// Software caused connection to abort.
/// </para>
/// </devdoc>
ConnectionAborted = (10000 + 53), //WSAECONNABORTED
/// <devdoc>
/// <para>
/// Connection reset by peer.
/// </para>
/// </devdoc>
ConnectionReset = (10000 + 54), //WSAECONNRESET
/// <devdoc>
/// No buffer space available.
/// </devdoc>
NoBufferSpaceAvailable = (10000 + 55), //WSAENOBUFS
/// <devdoc>
/// <para>
/// Socket is already connected.
/// </para>
/// </devdoc>
IsConnected = (10000 + 56), //WSAEISCONN
/// <devdoc>
/// <para>
/// Socket is not connected.
/// </para>
/// </devdoc>
NotConnected = (10000 + 57), //WSAENOTCONN
/// <devdoc>
/// <para>
/// Cannot send after socket shutdown.
/// </para>
/// </devdoc>
Shutdown = (10000 + 58), //WSAESHUTDOWN
/// <devdoc>
/// <para>
/// Connection timed out.
/// </para>
/// </devdoc>
TimedOut = (10000 + 60), //WSAETIMEDOUT
/// <devdoc>
/// <para>
/// Connection refused.
/// </para>
/// </devdoc>
ConnectionRefused = (10000 + 61), //WSAECONNREFUSED
/// <devdoc>
/// <para>
/// Host is down.
/// </para>
/// </devdoc>
HostDown = (10000 + 64), //WSAEHOSTDOWN
/// <devdoc>
/// <para>
/// No route to host.
/// </para>
/// </devdoc>
HostUnreachable = (10000 + 65), //WSAEHOSTUNREACH
/// <devdoc>
/// <para>
/// Too many processes.
/// </para>
/// </devdoc>
ProcessLimit = (10000 + 67), //WSAEPROCLIM
/// <devdoc>
/// <para>
/// [To be supplied.]
/// </para>
/// </devdoc>
/*
* Extended Windows Sockets error constant definitions
*/
/// <devdoc>
/// <para>
/// Network subsystem is unavailable.
/// </para>
/// </devdoc>
SystemNotReady = (10000 + 91), //WSASYSNOTREADY
/// <devdoc>
/// <para>
/// Winsock.dll out of range.
/// </para>
/// </devdoc>
VersionNotSupported = (10000 + 92), //WSAVERNOTSUPPORTED
/// <devdoc>
/// <para>
/// Successful startup not yet performed.
/// </para>
/// </devdoc>
NotInitialized = (10000 + 93), //WSANOTINITIALISED
// WSAEREMOTE = (10000+71),
/// <devdoc>
/// <para>
/// Graceful shutdown in progress.
/// </para>
/// </devdoc>
Disconnecting = (10000 + 101), //WSAEDISCON
TypeNotFound = (10000 + 109), //WSATYPE_NOT_FOUND
/*
* Error return codes from gethostbyname() and gethostbyaddr()
* = (when using the resolver). Note that these errors are
* retrieved via WSAGetLastError() and must therefore follow
* the rules for avoiding clashes with error numbers from
* specific implementations or language run-time systems.
* For this reason the codes are based at 10000+1001.
* Note also that [WSA]NO_ADDRESS is defined only for
* compatibility purposes.
*/
/// <devdoc>
/// <para>
/// Host not found (Authoritative Answer: Host not found).
/// </para>
/// </devdoc>
HostNotFound = (10000 + 1001), //WSAHOST_NOT_FOUND
/// <devdoc>
/// <para>
/// Nonauthoritative host not found (Non-Authoritative: Host not found, or SERVERFAIL).
/// </para>
/// </devdoc>
TryAgain = (10000 + 1002), //WSATRY_AGAIN
/// <devdoc>
/// <para>
/// This is a nonrecoverable error (Non recoverable errors, FORMERR, REFUSED, NOTIMP).
/// </para>
/// </devdoc>
NoRecovery = (10000 + 1003), //WSANO_RECOVERY
/// <devdoc>
/// <para>
/// Valid name, no data record of requested type.
/// </para>
/// </devdoc>
NoData = (10000 + 1004), //WSANO_DATA
}
}