[Socket] Inline InvalidAsyncOp into ValidateEndIAsyncResult
authorLudovic Henry <ludovic.henry@xamarin.com>
Thu, 9 Apr 2015 10:46:30 +0000 (11:46 +0100)
committerLudovic Henry <ludovic.henry@xamarin.com>
Thu, 9 Apr 2015 13:37:32 +0000 (14:37 +0100)
mcs/class/System/System.Net.Sockets/Socket.cs
mcs/class/System/System.Net.Sockets/Socket_2_1.cs

index cdefeb3d50d71bc85b79f59cc99283ee3be83873..6667a5476662eaa1e8985bd05c83d1a6ac0c7bbc 100644 (file)
@@ -3152,7 +3152,7 @@ namespace System.Net.Sockets
                        if (sockares == null)
                                throw new ArgumentException ("Invalid IAsyncResult", argName);
                        if (Interlocked.CompareExchange (ref sockares.EndCalled, 1, 0) == 1)
-                               throw InvalidAsyncOp (methodName);
+                               throw new InvalidOperationException (methodName + " can only be called once per asynchronous operation");
 
                        return sockares;
                }
index a6df431dc6d719af4505b3c60152badd3364a367..9810ce4fc6542f1e8829cab8ebe0657ae7a80053 100644 (file)
@@ -61,11 +61,6 @@ namespace System.Net.Sockets {
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                internal static extern void cancel_blocking_socket_operation (Thread thread);
 
-               Exception InvalidAsyncOp (string method)
-               {
-                       return new InvalidOperationException (method + " can only be called once per asynchronous operation");
-               }
-
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                internal static extern void socket_pool_queue (SocketAsyncCallback d, SocketAsyncResult r);
        }