586 references to SocketError
System (562)
net\System\Net\_AutoWebProxyScriptHelper.cs (3)
588
SocketError
errorCode =
595
if(errorCode !=
SocketError
.Success)
607
if(errorCode !=
SocketError
.Success)
net\System\Net\_Connection.cs (1)
3374
if (socketException.ErrorCode == (int)
SocketError
.TimedOut)
net\System\Net\_ConnectStream.cs (1)
1432
if (win32Exception != null && win32Exception.NativeErrorCode == (int)
SocketError
.TimedOut)
net\System\Net\_SafeNetHandles.cs (25)
2577
SocketError
errorCode;
2591
if (errorCode ==
SocketError
.SocketError) errorCode = (
SocketError
) Marshal.GetLastWin32Error();
2595
if (errorCode !=
SocketError
.WouldBlock)
2597
return ret = errorCode ==
SocketError
.Success;
2607
if (errorCode ==
SocketError
.SocketError) errorCode = (
SocketError
) Marshal.GetLastWin32Error();
2611
if (errorCode ==
SocketError
.InvalidArgument)
2617
GlobalLog.Print("SafeCloseSocket::ReleaseHandle(handle:" + handle.ToString("x") + ") WSAEventSelect():" + (errorCode ==
SocketError
.SocketError ? (
SocketError
)Marshal.GetLastWin32Error() : errorCode).ToString());
2624
GlobalLog.Print("SafeCloseSocket::ReleaseHandle(handle:" + handle.ToString("x") + ") ioctlsocket#2():" + (errorCode ==
SocketError
.SocketError ? (
SocketError
)Marshal.GetLastWin32Error() : errorCode).ToString());
2628
if (errorCode ==
SocketError
.Success)
2635
if (errorCode ==
SocketError
.SocketError) errorCode = (
SocketError
) Marshal.GetLastWin32Error();
2639
if (errorCode !=
SocketError
.WouldBlock)
2641
return ret = errorCode ==
SocketError
.Success;
2662
if (errorCode ==
SocketError
.SocketError) errorCode = (
SocketError
) Marshal.GetLastWin32Error();
2665
if (errorCode !=
SocketError
.Success && errorCode !=
SocketError
.InvalidArgument && errorCode !=
SocketError
.ProtocolOption)
2676
GlobalLog.Print("SafeCloseSocket::ReleaseHandle(handle:" + handle.ToString("x") + ") closesocket#3():" + (errorCode ==
SocketError
.SocketError ? (
SocketError
)Marshal.GetLastWin32Error() : errorCode).ToString());
2678
return ret = errorCode ==
SocketError
.Success;
net\System\Net\DNS.cs (19)
354
SocketError
errorCode =
SocketError
.Success;
365
if(errorCode ==
SocketError
.Success) {
370
if (errorCode ==
SocketError
.Success)
398
throw new SocketException(
SocketError
.ProtocolNotSupported);
461
SocketError
errorCode =
469
if (errorCode!=
SocketError
.Success) {
572
if (
SocketError
.Success != TryGetAddrInfo(hostName, AddressInfoHints.AI_CANONNAME, out canonicalResult))
601
if (
SocketError
.Success != TryGetAddrInfo(hostName, AddressInfoHints.AI_FQDN, out fqdnResult))
1076
SocketError
errorCode = TryGetAddrInfo(name, out hostEntry);
1077
if (errorCode !=
SocketError
.Success) {
1086
private unsafe static
SocketError
TryGetAddrInfo(string name, out IPHostEntry hostinfo)
1092
private unsafe static
SocketError
TryGetAddrInfo(string name, AddressInfoHints flags, out IPHostEntry hostinfo)
1113
SocketError
errorCode = (
SocketError
)SafeFreeAddrInfo.GetAddrInfo(name, null, ref hints, out root);
1114
if (errorCode !=
SocketError
.Success) { // Should not throw, return mostly blank hostentry
1185
return
SocketError
.Success;
1189
internal static string TryGetNameInfo(IPAddress addr, out
SocketError
errorCode) {
1214
if (errorCode!=
SocketError
.Success) {
net\System\Net\FtpWebRequest.cs (1)
1132
if (sEx.ErrorCode == (int)
SocketError
.TimedOut) {
net\System\Net\Internal.cs (11)
574
SocketError
errorCode;
578
errorCode = (
SocketError
)UnsafeNclNativeMethods.OSSOCK.WSAIoctl_Blocking(
585
if (errorCode !=
SocketError
.Success) {
587
if (exception.ErrorCode != (uint)
SocketError
.WouldBlock) {
593
errorCode = (
SocketError
)UnsafeNclNativeMethods.OSSOCK.WSAEventSelect(ipv4Socket, ipv4Socket.GetEventHandle().SafeWaitHandle, AsyncEventBits.FdAddressListChange);
594
if (errorCode !=
SocketError
.Success) {
601
errorCode = (
SocketError
) UnsafeNclNativeMethods.OSSOCK.WSAIoctl_Blocking(
608
if (errorCode !=
SocketError
.Success) {
610
if (exception.ErrorCode != (uint)
SocketError
.WouldBlock) {
616
errorCode = (
SocketError
)UnsafeNclNativeMethods.OSSOCK.WSAEventSelect(ipv6Socket, ipv6Socket.GetEventHandle().SafeWaitHandle, AsyncEventBits.FdAddressListChange);
617
if (errorCode !=
SocketError
.Success) {
net\System\Net\IPAddress.cs (9)
192
SocketError
errorCode =
200
if (errorCode ==
SocketError
.Success)
261
e = new SocketException(
SocketError
.InvalidArgument);
326
throw new SocketException(
SocketError
.OperationNotSupported);
336
throw new SocketException(
SocketError
.OperationNotSupported);
390
throw new SocketException(
SocketError
.OperationNotSupported);
400
throw new SocketException(
SocketError
.OperationNotSupported);
449
SocketError
errorCode =
456
if (errorCode!=
SocketError
.Success) {
net\System\Net\NetworkInformation\NetworkAddressChange.cs (11)
284
SocketError
errorCode;
294
errorCode = (
SocketError
) UnsafeNclNativeMethods.OSSOCK.WSAIoctl_Blocking(
301
if (errorCode !=
SocketError
.Success) {
303
if (exception.ErrorCode != (uint)
SocketError
.WouldBlock) {
308
errorCode = (
SocketError
)UnsafeNclNativeMethods.OSSOCK.WSAEventSelect(s_ipv4Socket, s_ipv4Socket.GetEventHandle().SafeWaitHandle, AsyncEventBits.FdAddressListChange);
309
if (errorCode !=
SocketError
.Success) {
322
errorCode = (
SocketError
) UnsafeNclNativeMethods.OSSOCK.WSAIoctl_Blocking(
329
if (errorCode !=
SocketError
.Success) {
331
if (exception.ErrorCode != (uint)
SocketError
.WouldBlock) {
336
errorCode = (
SocketError
)UnsafeNclNativeMethods.OSSOCK.WSAEventSelect(s_ipv6Socket, s_ipv6Socket.GetEventHandle().SafeWaitHandle, AsyncEventBits.FdAddressListChange);
337
if (errorCode !=
SocketError
.Success) {
net\System\Net\NetworkInformation\NetworkInformationException.cs (1)
38
internal NetworkInformationException(
SocketError
socketError) : base((int)socketError) {
net\System\Net\NetworkInformation\SystemIPInterfaceProperties.cs (2)
77
throw new NetworkInformationException(
SocketError
.ProtocolNotSupported);
84
throw new NetworkInformationException(
SocketError
.ProtocolNotSupported);
net\System\Net\SocketAddress.cs (1)
205
throw new SocketException(
SocketError
.AddressFamilyNotSupported);
net\System\Net\SocketException.cs (3)
55
internal SocketException(
SocketError
socketError) : base((int)socketError) {
89
public
SocketError
SocketErrorCode {
95
return (
SocketError
)NativeErrorCode;
net\System\Net\Sockets\_AcceptOverlappedAsyncResult.cs (7)
49
SocketError
errorCode = (
SocketError
)ErrorCode;
52
if (errorCode==
SocketError
.Success) {
89
if (errorCode ==
SocketError
.SocketError) errorCode = (
SocketError
) Marshal.GetLastWin32Error();
94
errorCode =
SocketError
.OperationAborted;
100
if (errorCode==
SocketError
.Success) {
net\System\Net\Sockets\_BaseOverlappedAsyncResult.cs (14)
337
SocketError
socketError = (
SocketError
)errorCode;
339
if (socketError !=
SocketError
.Success && socketError !=
SocketError
.OperationAborted)
349
socketError =
SocketError
.NotSocket;
352
socketError =
SocketError
.OperationAborted;
369
socketError = (
SocketError
)Marshal.GetLastWin32Error();
378
socketError =
SocketError
.OperationAborted;
448
internal unsafe
SocketError
CheckAsyncCallOverlappedResult(
SocketError
errorCode)
469
case
SocketError
.IOPending:
487
return
SocketError
.Success;
523
case
SocketError
.IOPending:
527
return
SocketError
.Success;
net\System\Net\Sockets\_ConnectOverlappedAsyncResult.cs (7)
33
SocketError
errorCode = (
SocketError
)ErrorCode;
36
if (errorCode==
SocketError
.Success) {
47
if (errorCode ==
SocketError
.SocketError) errorCode = (
SocketError
) Marshal.GetLastWin32Error();
51
errorCode =
SocketError
.OperationAborted;
57
if (errorCode==
SocketError
.Success) {
net\System\Net\Sockets\_DisconnectOverlappedAsyncResult.cs (1)
31
if (ErrorCode == (int)
SocketError
.Success) {
net\System\Net\Sockets\_DynamicWinsockMethods.cs (4)
115
SocketError
errorCode;
131
if (errorCode !=
SocketError
.Success)
282
internal delegate
SocketError
WSARecvMsgDelegate(
290
internal delegate
SocketError
WSARecvMsgDelegate_Blocking(
net\System\Net\Sockets\_MultipleConnectAsync.cs (10)
53
SyncFail(new SocketException(
SocketError
.OperationAborted));
154
exception = new SocketException(
SocketError
.OperationAborted);
160
if (args.SocketError ==
SocketError
.Success)
166
else if (args.SocketError ==
SocketError
.OperationAborted)
170
exception = new SocketException(
SocketError
.OperationAborted);
178
SocketError
currentFailure = args.SocketError;
189
if (socketException != null && socketException.SocketErrorCode ==
SocketError
.NoData)
227
return new SocketException(
SocketError
.NoData);
243
return new SocketException(
SocketError
.OperationAborted);
362
AsyncFail(new SocketException(
SocketError
.OperationAborted));
net\System\Net\Sockets\Socket.cs (377)
194
if(e.ErrorCode == (int)
SocketError
.InvalidArgument){
229
SocketError
errorCode;
239
errorCode =
SocketError
.NotSocket;
242
if (errorCode ==
SocketError
.Success) {
354
SocketError
errorCode = UnsafeNclNativeMethods.OSSOCK.ioctlsocket(
364
if (errorCode==
SocketError
.SocketError) {
408
SocketError
errorCode = UnsafeNclNativeMethods.OSSOCK.getsockname(
413
if (errorCode!=
SocketError
.Success) {
455
SocketError
errorCode = UnsafeNclNativeMethods.OSSOCK.getpeername(
460
if (errorCode!=
SocketError
.Success) {
522
SocketError
errorCode = InternalSetBlocking(value, out current);
524
if (errorCode!=
SocketError
.Success) {
943
SocketException socketException = new SocketException(
SocketError
.InvalidArgument);
950
SocketError
errorCode = UnsafeNclNativeMethods.OSSOCK.bind(
966
if (errorCode !=
SocketError
.Success)
1175
SocketError
errorCode = UnsafeNclNativeMethods.OSSOCK.listen(
1190
if (errorCode!=
SocketError
.Success) {
1297
SocketError
errorCode;
1299
if(errorCode !=
SocketError
.Success){
1306
public int Send(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out
SocketError
errorCode) {
1325
errorCode =
SocketError
.Success;
1352
if ((
SocketError
)errorCode==
SocketError
.SocketError) {
1353
errorCode = (
SocketError
)Marshal.GetLastWin32Error();
1371
if (errorCode !=
SocketError
.Success) {
1452
SocketError
errorCode =
SocketError
.Success;
1461
errorCode = (
SocketError
) Marshal.GetLastWin32Error();
1479
if (errorCode!=
SocketError
.Success) {
1508
SocketError
errorCode;
1510
if(errorCode !=
SocketError
.Success){
1518
public int Send(byte[] buffer, int offset, int size, SocketFlags socketFlags, out
SocketError
errorCode) {
1538
errorCode =
SocketError
.Success;
1561
if ((
SocketError
)bytesTransferred==
SocketError
.SocketError) {
1565
errorCode = (
SocketError
)Marshal.GetLastWin32Error();
1658
if ((
SocketError
)bytesTransferred==
SocketError
.SocketError) {
1739
SocketError
errorCode;
1741
if(errorCode !=
SocketError
.Success){
1748
public int Receive(byte[] buffer, int offset, int size, SocketFlags socketFlags, out
SocketError
errorCode) {
1773
errorCode =
SocketError
.Success;
1784
if ((
SocketError
)bytesTransferred==
SocketError
.SocketError) {
1788
errorCode = (
SocketError
)Marshal.GetLastWin32Error();
1833
SocketError
errorCode;
1835
if(errorCode !=
SocketError
.Success){
1841
public int Receive(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out
SocketError
errorCode) {
1865
errorCode =
SocketError
.Success;
1888
if ((
SocketError
)errorCode==
SocketError
.SocketError) {
1889
errorCode = (
SocketError
)Marshal.GetLastWin32Error();
1906
if (errorCode !=
SocketError
.Success) {
1997
SocketError
errorCode =
SocketError
.Success;
2009
IntPtr.Zero) ==
SocketError
.SocketError)
2011
errorCode = (
SocketError
)Marshal.GetLastWin32Error();
2022
if (errorCode!=
SocketError
.Success && errorCode !=
SocketError
.MessageSize) {
2111
if ((
SocketError
) bytesTransferred ==
SocketError
.SocketError)
2117
if(socketException.ErrorCode != (int)
SocketError
.MessageSize){
2197
SocketError
errorCode = UnsafeNclNativeMethods.OSSOCK.WSAIoctl_Blocking(
2213
if (errorCode==
SocketError
.SocketError) {
2250
SocketError
errorCode = UnsafeNclNativeMethods.OSSOCK.WSAIoctl_Blocking_Internal(
2266
if (errorCode==
SocketError
.SocketError) {
2323
SocketError
errorCode = UnsafeNclNativeMethods.OSSOCK.setsockopt(
2335
if (errorCode==
SocketError
.SocketError) {
2432
SocketError
errorCode = UnsafeNclNativeMethods.OSSOCK.getsockopt(
2444
if (errorCode==
SocketError
.SocketError) {
2470
SocketError
errorCode = UnsafeNclNativeMethods.OSSOCK.getsockopt(
2482
if (errorCode==
SocketError
.SocketError) {
2506
SocketError
errorCode = UnsafeNclNativeMethods.OSSOCK.getsockopt(
2518
if (errorCode==
SocketError
.SocketError) {
2580
if ((
SocketError
)socketCount==
SocketError
.SocketError) {
2658
if ((
SocketError
)socketCount==
SocketError
.SocketError) {
2806
SocketError
errorCode;
2810
errorCode = (
SocketError
) UnsafeNclNativeMethods.OSSOCK.WSADuplicateSocket(m_Handle, (uint)targetProcessId, pinnedBuffer);
2817
if (errorCode!=
SocketError
.Success) {
2884
SocketError
errorCode = UnsafeNclNativeMethods.OSSOCK.WSAConnect(
2893
if (errorCode!=
SocketError
.Success) {
2894
errorCode = (
SocketError
)Marshal.GetLastWin32Error();
2898
if (errorCode !=
SocketError
.WouldBlock)
2901
if (errorCode ==
SocketError
.Success)
2922
if (errorCode ==
SocketError
.Success)
3013
SocketError
errorCode =
SocketError
.OperationAborted;
3027
if (errorCode !=
SocketError
.Success)
3029
errorCode = (
SocketError
) Marshal.GetLastWin32Error();
3034
errorCode = (
SocketError
) networkEvents.ErrorCodes[(int) AsyncEventBitsPos.FdConnectBit];
3044
errorCode =
SocketError
.OperationAborted;
3051
if (errorCode ==
SocketError
.Success)
3232
SocketError
errorCode=
SocketError
.Success;
3236
errorCode = (
SocketError
)Marshal.GetLastWin32Error();
3239
if (errorCode ==
SocketError
.Success) {
3251
if (errorCode!=
SocketError
.Success) {
3281
SocketError
errorCode =
SocketError
.Success;
3286
errorCode = (
SocketError
)Marshal.GetLastWin32Error();
3292
if (errorCode!=
SocketError
.Success) {
3383
if ((
SocketError
)castedAsyncResult.ErrorCode!=
SocketError
.Success) {
3427
SocketError
errorCode;
3429
if(errorCode !=
SocketError
.Success && errorCode !=
SocketError
.IOPending){
3436
public IAsyncResult BeginSend(byte[] buffer, int offset, int size, SocketFlags socketFlags, out
SocketError
errorCode, AsyncCallback callback, object state)
3467
if(errorCode !=
SocketError
.Success && errorCode !=
SocketError
.IOPending){
3493
SocketError
errorCode = DoBeginSend(buffer, offset, size, socketFlags, asyncResult);
3494
if(errorCode !=
SocketError
.Success && errorCode !=
SocketError
.IOPending){
3502
private
SocketError
DoBeginSend(byte[] buffer, int offset, int size, SocketFlags socketFlags, OverlappedAsyncResult asyncResult)
3509
SocketError
errorCode =
SocketError
.SocketError;
3532
if (errorCode!=
SocketError
.Success) {
3533
errorCode = (
SocketError
)Marshal.GetLastWin32Error();
3546
if (errorCode !=
SocketError
.Success)
3634
SocketError
errorCode =
SocketError
.SocketError;
3649
errorCode = (
SocketError
)Marshal.GetLastWin32Error();
3653
errorCode =
SocketError
.Success;
3664
if (errorCode!=
SocketError
.Success) {
3690
SocketError
errorCode;
3692
if(errorCode !=
SocketError
.Success && errorCode !=
SocketError
.IOPending){
3700
public IAsyncResult BeginSend(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out
SocketError
errorCode, AsyncCallback callback, object state)
3731
if(errorCode !=
SocketError
.Success && errorCode !=
SocketError
.IOPending){
3739
private
SocketError
DoBeginSend(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, OverlappedAsyncResult asyncResult)
3746
SocketError
errorCode =
SocketError
.SocketError;
3766
if (errorCode!=
SocketError
.Success) {
3767
errorCode = (
SocketError
)Marshal.GetLastWin32Error();
3780
if (errorCode !=
SocketError
.Success)
3812
SocketError
errorCode;
3814
if(errorCode !=
SocketError
.Success){
3821
public int EndSend(IAsyncResult asyncResult, out
SocketError
errorCode) {
3861
errorCode = (
SocketError
)castedAsyncResult.ErrorCode;
3862
if (errorCode !=
SocketError
.Success) {
3921
if ((
SocketError
)castedAsyncResult.ErrorCode!=
SocketError
.Success) {
4014
SocketError
errorCode =
SocketError
.SocketError;
4038
if (errorCode!=
SocketError
.Success) {
4039
errorCode = (
SocketError
)Marshal.GetLastWin32Error();
4057
if (errorCode!=
SocketError
.Success) {
4132
if ((
SocketError
)castedAsyncResult.ErrorCode!=
SocketError
.Success) {
4181
SocketError
errorCode;
4183
if(errorCode !=
SocketError
.Success && errorCode !=
SocketError
.IOPending){
4191
public IAsyncResult BeginReceive(byte[] buffer, int offset, int size, SocketFlags socketFlags, out
SocketError
errorCode, AsyncCallback callback, object state)
4220
if(errorCode !=
SocketError
.Success && errorCode !=
SocketError
.IOPending){
4251
private
SocketError
DoBeginReceive(byte[] buffer, int offset, int size, SocketFlags socketFlags, OverlappedAsyncResult asyncResult)
4260
SocketError
errorCode =
SocketError
.SocketError;
4278
if (errorCode!=
SocketError
.Success) {
4279
errorCode = (
SocketError
)Marshal.GetLastWin32Error();
4280
GlobalLog.Assert(errorCode !=
SocketError
.Success, "Socket#{0}::DoBeginReceive()|GetLastWin32Error() returned zero.", ValidationHelper.HashString(this));
4293
if (errorCode !=
SocketError
.Success)
4318
SocketError
errorCode;
4320
if(errorCode !=
SocketError
.Success && errorCode !=
SocketError
.IOPending){
4328
public IAsyncResult BeginReceive(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out
SocketError
errorCode, AsyncCallback callback, object state)
4355
if(errorCode !=
SocketError
.Success && errorCode !=
SocketError
.IOPending){
4369
private
SocketError
DoBeginReceive(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, OverlappedAsyncResult asyncResult)
4376
SocketError
errorCode =
SocketError
.SocketError;
4394
if (errorCode!=
SocketError
.Success) {
4395
errorCode = (
SocketError
)Marshal.GetLastWin32Error();
4396
GlobalLog.Assert(errorCode !=
SocketError
.Success, "Socket#{0}::DoBeginReceive()|GetLastWin32Error() returned zero.", ValidationHelper.HashString(this));
4409
if (errorCode !=
SocketError
.Success)
4457
SocketError
errorCode;
4459
if(errorCode !=
SocketError
.Success){
4466
public int EndReceive(IAsyncResult asyncResult, out
SocketError
errorCode) {
4513
errorCode = (
SocketError
)castedAsyncResult.ErrorCode;
4514
if (errorCode!=
SocketError
.Success) {
4573
SocketError
errorCode =
SocketError
.SocketError;
4590
errorCode = (
SocketError
) WSARecvMsg(
4597
if (errorCode!=
SocketError
.Success) {
4598
errorCode = (
SocketError
)Marshal.GetLastWin32Error();
4604
if (errorCode ==
SocketError
.MessageSize)
4607
errorCode =
SocketError
.IOPending;
4627
if (errorCode!=
SocketError
.Success)
4715
if ((
SocketError
)castedAsyncResult.ErrorCode!=
SocketError
.Success && (
SocketError
)castedAsyncResult.ErrorCode !=
SocketError
.MessageSize) {
4832
SocketError
errorCode =
SocketError
.SocketError;
4858
if (errorCode!=
SocketError
.Success) {
4859
errorCode = (
SocketError
)Marshal.GetLastWin32Error();
4877
if (errorCode!=
SocketError
.Success) {
4975
if ((
SocketError
)castedAsyncResult.ErrorCode!=
SocketError
.Success) {
5074
SocketError
errorCode = 0;
5095
errorCode = acceptedSocketHandle.IsInvalid ? (
SocketError
) Marshal.GetLastWin32Error() :
SocketError
.Success;
5099
errorCode =
SocketError
.NotSocket;
5104
if (errorCode !=
SocketError
.WouldBlock)
5106
if (errorCode ==
SocketError
.Success)
5140
if (errorCode ==
SocketError
.Success)
5184
asyncResult.InvokeCallback(new SocketException(
SocketError
.OperationAborted));
5208
SocketError
errorCode =
SocketError
.OperationAborted;
5250
errorCode = acceptedSocket.IsInvalid ? (
SocketError
) Marshal.GetLastWin32Error() :
SocketError
.Success;
5257
errorCode =
SocketError
.OperationAborted;
5268
if (errorCode ==
SocketError
.WouldBlock && otherException == null)
5290
else if (errorCode ==
SocketError
.Success)
5417
SocketError
errorCode =
SocketError
.Success;
5428
errorCode = (
SocketError
)Marshal.GetLastWin32Error();
5438
if (errorCode!=
SocketError
.Success) {
5517
if ((
SocketError
)castedAsyncResult.ErrorCode!=
SocketError
.Success) {
5595
if ((
SocketError
)castedAsyncResult.ErrorCode!=
SocketError
.Success) {
5640
SocketError
errorCode = UnsafeNclNativeMethods.OSSOCK.shutdown(m_Handle, (int) how);
5645
errorCode = errorCode!=
SocketError
.SocketError ?
SocketError
.Success : (
SocketError
)Marshal.GetLastWin32Error();
5652
if (errorCode!=
SocketError
.Success && errorCode!=
SocketError
.NotSocket) {
5776
private
SocketError
WSARecvMsg(SafeCloseSocket socketHandle, IntPtr msg, out int bytesTransferred, SafeHandle overlapped, IntPtr completionRoutine)
5784
private
SocketError
WSARecvMsg_Blocking(IntPtr socketHandle, IntPtr msg, out int bytesTransferred, IntPtr overlapped, IntPtr completionRoutine)
5961
SocketError
errorCode =
5966
if (errorCode!=
SocketError
.Success) {
6002
errorCode = (
SocketError
) Marshal.GetLastWin32Error();
6003
if (errorCode ==
SocketError
.AddressFamilyNotSupported)
6018
errorCode = (
SocketError
) Marshal.GetLastWin32Error();
6019
if (errorCode ==
SocketError
.AddressFamilyNotSupported)
6157
if ((
SocketError
)castedAsyncResult.ErrorCode !=
SocketError
.Success)
6184
SocketError
errorCode = UnsafeNclNativeMethods.OSSOCK.WSAConnect(
6204
if (errorCode!=
SocketError
.Success) {
6306
SocketError
errorCode;
6316
GlobalLog.Print("SafeCloseSocket::Dispose(handle:" + m_Handle.DangerousGetHandle().ToString("x") + ") ioctlsocket(FIONBIO):" + (errorCode ==
SocketError
.SocketError ? (
SocketError
) Marshal.GetLastWin32Error() : errorCode).ToString());
6329
GlobalLog.Print("SafeCloseSocket::Dispose(handle:" + m_Handle.DangerousGetHandle().ToString("x") + ") shutdown():" + (errorCode ==
SocketError
.SocketError ? (
SocketError
) Marshal.GetLastWin32Error() : errorCode).ToString());
6338
GlobalLog.Print("SafeCloseSocket::Dispose(handle:" + m_Handle.DangerousGetHandle().ToString("x") + ") setsockopt():" + (errorCode ==
SocketError
.SocketError ? (
SocketError
) Marshal.GetLastWin32Error() : errorCode).ToString());
6340
if (errorCode !=
SocketError
.Success)
6348
errorCode = (
SocketError
) UnsafeNclNativeMethods.OSSOCK.recv(m_Handle.DangerousGetHandle(), null, 0, SocketFlags.None);
6352
if (errorCode != (
SocketError
) 0)
6365
GlobalLog.Print("SafeCloseSocket::Dispose(handle:" + m_Handle.DangerousGetHandle().ToString("x") + ") ioctlsocket(FIONREAD):" + (errorCode ==
SocketError
.SocketError ? (
SocketError
) Marshal.GetLastWin32Error() : errorCode).ToString());
6367
if (errorCode !=
SocketError
.Success || dataAvailable != 0)
6402
ThreadPool.UnsafeQueueUserWorkItem(new WaitCallback(((LazyAsyncResult)m_AcceptQueueOrConnectResult).InvokeCallback), new SocketException(
SocketError
.OperationAborted));
6475
SocketError
errorCode =
SocketError
.Success;
6496
errorCode ==
SocketError
.Success)
6508
if (errorCode==
SocketError
.SocketError) {
6550
SocketError
errorCode = UnsafeNclNativeMethods.OSSOCK.setsockopt(
6562
if (errorCode==
SocketError
.SocketError) {
6588
SocketError
errorCode = UnsafeNclNativeMethods.OSSOCK.setsockopt(
6600
if (errorCode==
SocketError
.SocketError) {
6619
SocketError
errorCode = UnsafeNclNativeMethods.OSSOCK.setsockopt(
6631
if (errorCode==
SocketError
.SocketError) {
6647
SocketError
errorCode = UnsafeNclNativeMethods.OSSOCK.getsockopt(
6659
if (errorCode==
SocketError
.SocketError) {
6678
SocketError
errorCode = UnsafeNclNativeMethods.OSSOCK.getsockopt(
6690
if (errorCode==
SocketError
.SocketError) {
6731
SocketError
errorCode = UnsafeNclNativeMethods.OSSOCK.getsockopt(
6743
if (errorCode==
SocketError
.SocketError) {
6762
private
SocketError
InternalSetBlocking(bool desired, out bool current) {
6768
return
SocketError
.Success;
6774
SocketError
errorCode;
6782
if (errorCode ==
SocketError
.SocketError)
6784
errorCode = (
SocketError
) Marshal.GetLastWin32Error();
6789
errorCode =
SocketError
.NotSocket;
6798
if (errorCode==
SocketError
.Success) {
6916
SocketError
errorCode=
SocketError
.Success;
6931
errorCode = (
SocketError
)Marshal.GetLastWin32Error();
6946
if (errorCode ==
SocketError
.Success) {
6958
if (errorCode !=
SocketError
.Success) {
6993
SocketError
errorCode;
7024
if (errorCode!=
SocketError
.Success) {
7226
SocketError
errorCode =
SocketError
.SocketError;
7244
if (errorCode!=
SocketError
.Success) {
7245
errorCode = (
SocketError
)Marshal.GetLastWin32Error();
7258
if (errorCode!=
SocketError
.Success) {
7306
if ((
SocketError
)castedAsyncResult.ErrorCode!=
SocketError
.Success) {
7426
UpdateStatusAfterSocketError((
SocketError
) socketException.NativeErrorCode);
7429
internal void UpdateStatusAfterSocketError(
SocketError
errorCode)
7438
if (m_IsConnected && (m_Handle.IsInvalid || (errorCode !=
SocketError
.WouldBlock &&
7439
errorCode !=
SocketError
.IOPending && errorCode !=
SocketError
.NoBufferSpaceAvailable &&
7440
errorCode !=
SocketError
.TimedOut)))
7467
SocketError
errorCode =
SocketError
.NotSocket;
7491
if (errorCode ==
SocketError
.SocketError)
7551
SocketError
errorCode =
SocketError
.NotSocket;
7566
if (errorCode==
SocketError
.SocketError) {
7581
return errorCode ==
SocketError
.Success;
7722
SocketError
socketError =
SocketError
.Success;
7735
socketError = (
SocketError
)Marshal.GetLastWin32Error();
7745
if(socketError !=
SocketError
.Success && socketError !=
SocketError
.IOPending) {
7834
SocketError
socketError =
SocketError
.Success;
7844
socketError = (
SocketError
)Marshal.GetLastWin32Error();
7855
if(socketError !=
SocketError
.Success && socketError !=
SocketError
.IOPending) {
7937
SocketError
socketError =
SocketError
.Success;
7944
socketError = (
SocketError
)Marshal.GetLastWin32Error();
7954
if(socketError !=
SocketError
.Success && socketError !=
SocketError
.IOPending) {
7988
SocketError
socketError;
8022
if(socketError !=
SocketError
.Success) {
8023
socketError = (
SocketError
)Marshal.GetLastWin32Error();
8027
if(socketError !=
SocketError
.Success && socketError !=
SocketError
.IOPending) {
8079
SocketError
socketError;
8114
if(socketError !=
SocketError
.Success) {
8115
socketError = (
SocketError
)Marshal.GetLastWin32Error();
8119
if(socketError !=
SocketError
.Success && socketError !=
SocketError
.IOPending) {
8173
SocketError
socketError;
8191
if(socketError !=
SocketError
.Success) {
8192
socketError = (
SocketError
)Marshal.GetLastWin32Error();
8196
if(socketError !=
SocketError
.Success && socketError !=
SocketError
.IOPending) {
8230
SocketError
socketError;
8264
if(socketError !=
SocketError
.Success) {
8265
socketError = (
SocketError
)Marshal.GetLastWin32Error();
8269
if(socketError !=
SocketError
.Success && socketError !=
SocketError
.IOPending) {
8306
SocketError
socketError;
8326
socketError = (
SocketError
)Marshal.GetLastWin32Error();
8328
socketError =
SocketError
.Success;
8332
if(socketError !=
SocketError
.Success && socketError !=
SocketError
.IOPending) {
8341
e.FinishOperationSuccess(
SocketError
.Success, 0, SocketFlags.None);
8381
SocketError
socketError;
8420
if(socketError !=
SocketError
.Success) {
8421
socketError = (
SocketError
)Marshal.GetLastWin32Error();
8425
if(socketError !=
SocketError
.Success && socketError !=
SocketError
.IOPending) {
8633
private
SocketError
m_SocketError;
8844
public
SocketError
SocketError {
8913
internal void SetResults(
SocketError
socketError, int bytesTransferred, SocketFlags flags) {
8926
m_SocketError =
SocketError
.Success;
8934
m_SocketError =
SocketError
.SocketError;
9724
internal void FinishOperationSyncFailure(
SocketError
socketError, int bytesTransferred, SocketFlags flags) {
9746
internal void FinishOperationAsyncFailure(
SocketError
socketError, int bytesTransferred, SocketFlags flags) {
9779
SetResults(
SocketError
.Success, bytesTransferred, flags);
9792
internal void FinishOperationSuccess(
SocketError
socketError, int bytesTransferred, SocketFlags flags) {
9837
if(socketError ==
SocketError
.SocketError) {
9838
socketError = (
SocketError
)Marshal.GetLastWin32Error();
9842
socketError =
SocketError
.OperationAborted;
9845
if(socketError ==
SocketError
.Success) {
9872
if(socketError ==
SocketError
.SocketError) {
9873
socketError = (
SocketError
)Marshal.GetLastWin32Error();
9877
socketError =
SocketError
.OperationAborted;
9881
if(socketError ==
SocketError
.Success) {
10018
if(socketError !=
SocketError
.Success) {
10039
SocketError
socketError = (
SocketError
)errorCode;
10041
if(socketError ==
SocketError
.Success) {
10044
if(socketError !=
SocketError
.OperationAborted) {
10046
socketError =
SocketError
.OperationAborted;
10060
socketError = (
SocketError
)Marshal.GetLastWin32Error();
10064
socketError =
SocketError
.OperationAborted;
net\System\Net\Sockets\TCPClient.cs (2)
204
throw new SocketException(
SocketError
.IsConnected);
305
throw new SocketException(
SocketError
.NotConnected);
net\System\Net\Sockets\UDPClient.cs (4)
422
throw new SocketException(
SocketError
.NotConnected);
842
throw new SocketException(
SocketError
.OperationNotSupported);
881
throw new SocketException(
SocketError
.OperationNotSupported);
993
throw new SocketException(
SocketError
.OperationNotSupported);
net\System\Net\UnsafeNativeMethods.cs (43)
747
internal static extern
SocketError
closesocket(
753
internal static extern
SocketError
ioctlsocket(
761
internal static extern
SocketError
WSAEventSelect(
769
internal static extern
SocketError
setsockopt(
1042
internal static extern
SocketError
WSAStartup(
1049
internal static extern
SocketError
ioctlsocket(
1068
internal static extern
SocketError
gethostname(
1074
internal static extern
SocketError
getpeername(
1081
internal static extern
SocketError
getsockopt(
1090
internal static extern
SocketError
getsockopt(
1099
internal static extern
SocketError
getsockopt(
1108
internal static extern
SocketError
getsockopt(
1120
internal static extern
SocketError
getsockopt(
1129
internal static extern
SocketError
setsockopt(
1138
internal static extern
SocketError
setsockopt(
1147
internal static extern
SocketError
setsockopt(
1157
internal static extern
SocketError
setsockopt(
1166
internal static extern
SocketError
setsockopt(
1178
internal static extern
SocketError
setsockopt(
1254
internal static extern
SocketError
listen(
1260
internal static extern
SocketError
bind(
1267
internal static extern
SocketError
shutdown(
1295
internal static extern
SocketError
getsockname(
1321
internal static extern
SocketError
WSAConnect(
1333
internal static extern
SocketError
WSASend(
1344
internal static extern
SocketError
WSASend(
1355
internal static extern
SocketError
WSASend_Blocking(
1366
internal static extern
SocketError
WSASendTo(
1379
internal static extern
SocketError
WSASendTo(
1392
internal static extern
SocketError
WSARecv(
1403
internal static extern
SocketError
WSARecv(
1414
internal static extern
SocketError
WSARecv_Blocking(
1425
internal static extern
SocketError
WSARecvFrom(
1438
internal static extern
SocketError
WSARecvFrom(
1451
internal static extern
SocketError
WSAEventSelect(
1458
internal static extern
SocketError
WSAEventSelect(
1467
internal static extern
SocketError
WSAIoctl(
1480
internal static extern
SocketError
WSAIoctl_Blocking(
1493
internal static extern
SocketError
WSAIoctl_Blocking_Internal(
1506
internal static extern
SocketError
WSAEnumNetworkEvents(
1532
internal static extern
SocketError
WSAStringToAddress(
1540
internal static extern
SocketError
WSAAddressToString(
1548
internal static extern
SocketError
GetNameInfoW(
net\System\Net\WebSockets\WebSocketConnectionStream.cs (5)
662
if (m_WriteEventArgs.SocketError !=
SocketError
.Success)
714
if (m_WriteEventArgs.SocketError !=
SocketError
.Success)
784
if (m_ReadEventArgs.SocketError !=
SocketError
.Success)
906
if (eventArgs.SocketError !=
SocketError
.Success)
937
if (eventArgs.SocketError !=
SocketError
.Success)
System.Net (10)
AssemblyInfo.cs (1)
57
[assembly: TypeForwardedToAttribute(typeof(System.Net.Sockets.
SocketError
))]
net\UdpAnySourceMulticastClient.cs (5)
19
public IAsyncResult BeginJoinGroup(AsyncCallback callback, object state) { throw new SocketException((int)(
SocketError
.AccessDenied)); }
24
public IAsyncResult BeginReceiveFromGroup(byte[] buffer, int offset, int count, AsyncCallback callback, object state) { throw new SocketException((int)(
SocketError
.AccessDenied)); }
29
public IAsyncResult BeginSendTo(byte[] buffer, int offset, int count, IPEndPoint remoteEndPoint, AsyncCallback callback, object state) { throw new SocketException((int)(
SocketError
.AccessDenied)); }
34
public IAsyncResult BeginSendToGroup(byte[] buffer, int offset, int count, AsyncCallback callback, object state) { throw new SocketException((int)(
SocketError
.AccessDenied)); }
54
public int EndReceiveFromGroup(IAsyncResult result, out IPEndPoint source) { throw new SocketException((int)(
SocketError
.AccessDenied)); }
net\UdpSingleSourceMulticastClient.cs (4)
19
public IAsyncResult BeginJoinGroup(AsyncCallback callback, object state) { throw new SocketException((int)(
SocketError
.AccessDenied)); }
24
public IAsyncResult BeginReceiveFromSource(byte[] buffer, int offset, int count, AsyncCallback callback, object state) { throw new SocketException((int)(
SocketError
.AccessDenied)); }
29
public IAsyncResult BeginSendToSource(byte[] buffer, int offset, int count, int remotePort, AsyncCallback callback, object state) { throw new SocketException((int)(
SocketError
.AccessDenied)); }
44
public int EndReceiveFromSource(IAsyncResult result, out int sourcePort) { throw new SocketException((int)(
SocketError
.AccessDenied)); }
System.ServiceModel (3)
System\ServiceModel\Channels\SocketConnection.cs (3)
968
if (this.asyncWriteEventArgs.SocketError ==
SocketError
.Success)
1332
if (this.asyncReadEventArgs.SocketError ==
SocketError
.Success)
2367
if (this.socketAsyncEventArgs.SocketError ==
SocketError
.Success)
System.ServiceModel.Channels (11)
System\ServiceModel\Channels\UdpSocket.cs (3)
235
case
SocketError
.MessageSize: //10040
240
case
SocketError
.NetworkReset: //10052
245
case
SocketError
.ConnectionReset: //10054
System\ServiceModel\Channels\UdpUtility.cs (8)
56
SocketError
error;
61
case
SocketError
.ConnectionReset: //"ICMP Destination Unreachable" error - client closed the socket
62
case
SocketError
.NetworkReset: //ICMP: Time Exceeded (TTL expired)
63
case
SocketError
.MessageSize: //client sent a message larger than the max message size allowed.
430
if (ex.SocketErrorCode ==
SocketError
.AddressAlreadyInUse)
434
else if (ex.SocketErrorCode ==
SocketError
.AccessDenied)
516
public static bool TryGetSocketError(Exception ex, out
SocketError
error)
518
error =
SocketError
.SocketError;