[socket] Remove SocketAsyncWorker
authorLudovic Henry <ludovic@xamarin.com>
Tue, 15 Sep 2015 20:30:12 +0000 (21:30 +0100)
committerLudovic Henry <ludovic@xamarin.com>
Mon, 5 Oct 2015 17:49:19 +0000 (18:49 +0100)
By having the callbacks directly in Socket, we can remove the SocketAsyncWorker class. This also greatly simplify this part of the code, as the callbacks are at the same place as the Begin/End invokes.

12 files changed:
mcs/class/System/System-bare-net_4_5.csproj
mcs/class/System/System-bare-net_4_x.csproj
mcs/class/System/System-net_4_5.csproj
mcs/class/System/System-net_4_x.csproj
mcs/class/System/System-secxml-net_4_5.csproj
mcs/class/System/System-secxml-net_4_x.csproj
mcs/class/System/System.Net.Sockets/Socket.cs
mcs/class/System/System.Net.Sockets/SocketAsyncEventArgs.cs
mcs/class/System/System.Net.Sockets/SocketAsyncResult.cs
mcs/class/System/System.Net.Sockets/SocketAsyncWorker.cs [deleted file]
mcs/class/System/System.dll.sources
mcs/class/System/mobile_System.dll.sources

index 58f07d40c8aa50707a5e4dea7b001a45459b57d7..e4d6143438b38b89600b9f30b5dfa8dfbc018faa 100644 (file)
     <Compile Include="System.Net.Sockets\SocketAsyncEventArgs.cs" />\r
     <Compile Include="System.Net.Sockets\SocketAsyncOperation.cs" />\r
     <Compile Include="System.Net.Sockets\SocketAsyncResult.cs" />\r
-    <Compile Include="System.Net.Sockets\SocketAsyncWorker.cs" />\r
     <Compile Include="System.Net.Sockets\SocketError.cs" />\r
     <Compile Include="System.Net.Sockets\SocketException.cs" />\r
     <Compile Include="System.Net.Sockets\SocketFlags.cs" />\r
index e585668bec00c4e679b8dad12310a296721874b8..889f40af36d254a05797c2b99b17be29ad3a8331 100644 (file)
     <Compile Include="System.Net.Sockets\SocketAsyncEventArgs.cs" />\r
     <Compile Include="System.Net.Sockets\SocketAsyncOperation.cs" />\r
     <Compile Include="System.Net.Sockets\SocketAsyncResult.cs" />\r
-    <Compile Include="System.Net.Sockets\SocketAsyncWorker.cs" />\r
     <Compile Include="System.Net.Sockets\SocketError.cs" />\r
     <Compile Include="System.Net.Sockets\SocketException.cs" />\r
     <Compile Include="System.Net.Sockets\SocketFlags.cs" />\r
index 731ae63b8793f031d1da059761fc3238c3632e9d..9a6419cb52074ff8d1ebdac56d5bf7d9c123d6ce 100644 (file)
     <Compile Include="System.Net.Sockets\SocketAsyncEventArgs.cs" />\r
     <Compile Include="System.Net.Sockets\SocketAsyncOperation.cs" />\r
     <Compile Include="System.Net.Sockets\SocketAsyncResult.cs" />\r
-    <Compile Include="System.Net.Sockets\SocketAsyncWorker.cs" />\r
     <Compile Include="System.Net.Sockets\SocketError.cs" />\r
     <Compile Include="System.Net.Sockets\SocketException.cs" />\r
     <Compile Include="System.Net.Sockets\SocketFlags.cs" />\r
index 5d1e3a61eac403fcb40e18c669af6fd420f223c7..640a563a15a23201b4bd199baddddeceffd24a5b 100644 (file)
     <Compile Include="System.Net.Sockets\SocketAsyncEventArgs.cs" />\r
     <Compile Include="System.Net.Sockets\SocketAsyncOperation.cs" />\r
     <Compile Include="System.Net.Sockets\SocketAsyncResult.cs" />\r
-    <Compile Include="System.Net.Sockets\SocketAsyncWorker.cs" />\r
     <Compile Include="System.Net.Sockets\SocketError.cs" />\r
     <Compile Include="System.Net.Sockets\SocketException.cs" />\r
     <Compile Include="System.Net.Sockets\SocketFlags.cs" />\r
index c17518029fbb9eca45498ab8daa61e06206f8562..988bbb657377ab23b042b9485885f6df529c950d 100644 (file)
     <Compile Include="System.Net.Sockets\SocketAsyncEventArgs.cs" />\r
     <Compile Include="System.Net.Sockets\SocketAsyncOperation.cs" />\r
     <Compile Include="System.Net.Sockets\SocketAsyncResult.cs" />\r
-    <Compile Include="System.Net.Sockets\SocketAsyncWorker.cs" />\r
     <Compile Include="System.Net.Sockets\SocketError.cs" />\r
     <Compile Include="System.Net.Sockets\SocketException.cs" />\r
     <Compile Include="System.Net.Sockets\SocketFlags.cs" />\r
index 2ff919616222ff9e60f748e76f185ec7fbca0bb1..bd3c0c077b872ee6cbbe258a71651647459f68a1 100644 (file)
     <Compile Include="System.Net.Sockets\SocketAsyncEventArgs.cs" />\r
     <Compile Include="System.Net.Sockets\SocketAsyncOperation.cs" />\r
     <Compile Include="System.Net.Sockets\SocketAsyncResult.cs" />\r
-    <Compile Include="System.Net.Sockets\SocketAsyncWorker.cs" />\r
     <Compile Include="System.Net.Sockets\SocketError.cs" />\r
     <Compile Include="System.Net.Sockets\SocketException.cs" />\r
     <Compile Include="System.Net.Sockets\SocketFlags.cs" />\r
index ae5a75328e9f0dc1a29be028c19ad1b423d208c6..8a86ad855941bb17964b85bcb136f9c8717090ba 100644 (file)
@@ -953,7 +953,7 @@ namespace System.Net.Sockets
 
                        SocketAsyncResult sockares = CreateSocketAsyncResultFromSocketAsyncEventArgs (e, SocketOperation.Accept, e.AcceptCallback);
 
-                       QueueIOSelectorJob (readQ, sockares.handle, new IOSelectorJob (IOOperation.Read, s => ((SocketAsyncResult) s).Worker.Accept (), sockares));
+                       QueueIOSelectorJob (readQ, sockares.handle, new IOSelectorJob (IOOperation.Read, BeginAcceptCallback, sockares));
 
                        return true;
                }
@@ -967,11 +967,25 @@ namespace System.Net.Sockets
 
                        SocketAsyncResult sockares = new SocketAsyncResult (this, callback, state, SocketOperation.Accept);
 
-                       QueueIOSelectorJob (readQ, sockares.handle, new IOSelectorJob (IOOperation.Read, s => ((SocketAsyncResult) s).Worker.Accept (), sockares));
+                       QueueIOSelectorJob (readQ, sockares.handle, new IOSelectorJob (IOOperation.Read, BeginAcceptCallback, sockares));
 
                        return sockares;
                }
 
+               static IOAsyncCallback BeginAcceptCallback = new IOAsyncCallback (ares => {
+                       SocketAsyncResult sockares = (SocketAsyncResult) ares;
+                       Socket socket = null;
+
+                       try {
+                               socket = sockares.socket.Accept ();
+                       } catch (Exception e) {
+                               sockares.Complete (e);
+                               return;
+                       }
+
+                       sockares.Complete (socket);
+               });
+
                public IAsyncResult BeginAccept (int receiveSize, AsyncCallback callback, object state)
                {
                        ThrowIfDisposedAndClosed ();
@@ -986,7 +1000,7 @@ namespace System.Net.Sockets
                                SockFlags = SocketFlags.None,
                        };
 
-                       QueueIOSelectorJob (readQ, sockares.handle, new IOSelectorJob (IOOperation.Read, s => ((SocketAsyncResult) s).Worker.AcceptReceive (), sockares));
+                       QueueIOSelectorJob (readQ, sockares.handle, new IOSelectorJob (IOOperation.Read, BeginAcceptReceiveCallback, sockares));
 
                        return sockares;
                }
@@ -1012,7 +1026,7 @@ namespace System.Net.Sockets
                                if (acceptSocket.ProtocolType != ProtocolType.Tcp)
                                        throw new SocketException ((int)SocketError.InvalidArgument);
                        }
-                       
+
                        SocketAsyncResult sockares = new SocketAsyncResult (this, callback, state, SocketOperation.AcceptReceive) {
                                Buffer = new byte [receiveSize],
                                Offset = 0,
@@ -1021,11 +1035,46 @@ namespace System.Net.Sockets
                                AcceptSocket = acceptSocket,
                        };
 
-                       QueueIOSelectorJob (readQ, sockares.handle, new IOSelectorJob (IOOperation.Read, s => ((SocketAsyncResult) s).Worker.AcceptReceive (), sockares));
+                       QueueIOSelectorJob (readQ, sockares.handle, new IOSelectorJob (IOOperation.Read, BeginAcceptReceiveCallback, sockares));
 
                        return sockares;
                }
 
+               static IOAsyncCallback BeginAcceptReceiveCallback = new IOAsyncCallback (ares => {
+                       SocketAsyncResult sockares = (SocketAsyncResult) ares;
+                       Socket acc_socket = null;
+
+                       try {
+                               if (sockares.AcceptSocket == null) {
+                                       acc_socket = sockares.socket.Accept ();
+                               } else {
+                                       acc_socket = sockares.AcceptSocket;
+                                       sockares.socket.Accept (acc_socket);
+                               }
+                       } catch (Exception e) {
+                               sockares.Complete (e);
+                               return;
+                       }
+
+                       /* It seems the MS runtime special-cases 0-length requested receive data.  See bug 464201. */
+                       int total = 0;
+                       if (sockares.Size > 0) {
+                               try {
+                                       SocketError error;
+                                       total = acc_socket.Receive_nochecks (sockares.Buffer, sockares.Offset, sockares.Size, sockares.SockFlags, out error);
+                                       if (error != 0) {
+                                               sockares.Complete (new SocketException ((int) error));
+                                               return;
+                                       }
+                               } catch (Exception e) {
+                                       sockares.Complete (e);
+                                       return;
+                               }
+                       }
+
+                       sockares.Complete (acc_socket, total);
+               });
+
                public Socket EndAccept (IAsyncResult result)
                {
                        int bytes;
@@ -1053,7 +1102,7 @@ namespace System.Net.Sockets
                        buffer = sockares.Buffer;
                        bytesTransferred = sockares.Total;
 
-                       return sockares.Socket;
+                       return sockares.AcceptedSocket;
                }
 
                static SafeSocketHandle Accept_internal (SafeSocketHandle safeHandle, out int error, bool blocking)
@@ -1369,7 +1418,7 @@ namespace System.Net.Sockets
                        is_bound = false;
                        connect_in_progress = true;
 
-                       IOSelector.Add (sockares.handle, new IOSelectorJob (IOOperation.Write, s => ((SocketAsyncResult) s).Worker.Connect (), sockares));
+                       IOSelector.Add (sockares.handle, new IOSelectorJob (IOOperation.Write, BeginConnectCallback, sockares));
 
                        return sockares;
                }
@@ -1431,6 +1480,57 @@ namespace System.Net.Sockets
                        return sockares;
                }
 
+               static IOAsyncCallback BeginConnectCallback = new IOAsyncCallback (ares => {
+                       SocketAsyncResult sockares = (SocketAsyncResult) ares;
+
+                       if (sockares.EndPoint == null) {
+                               sockares.Complete (new SocketException ((int)SocketError.AddressNotAvailable));
+                               return;
+                       }
+
+                       SocketAsyncResult mconnect = sockares.AsyncState as SocketAsyncResult;
+                       bool is_mconnect = mconnect != null && mconnect.Addresses != null;
+
+                       try {
+                               EndPoint ep = sockares.EndPoint;
+                               int error_code = (int) sockares.socket.GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Error);
+
+                               if (error_code == 0) {
+                                       if (is_mconnect)
+                                               sockares = mconnect;
+
+                                       sockares.socket.seed_endpoint = ep;
+                                       sockares.socket.is_connected = true;
+                                       sockares.socket.is_bound = true;
+                                       sockares.socket.connect_in_progress = false;
+                                       sockares.error = 0;
+                                       sockares.Complete ();
+                                       return;
+                               }
+
+                               if (!is_mconnect) {
+                                       sockares.socket.connect_in_progress = false;
+                                       sockares.Complete (new SocketException (error_code));
+                                       return;
+                               }
+
+                               if (mconnect.CurrentAddress >= mconnect.Addresses.Length) {
+                                       mconnect.Complete (new SocketException (error_code));
+                                       return;
+                               }
+
+                               mconnect.socket.BeginMConnect (mconnect);
+                       } catch (Exception e) {
+                               sockares.socket.connect_in_progress = false;
+
+                               if (is_mconnect)
+                                       sockares = mconnect;
+
+                               sockares.Complete (e);
+                               return;
+                       }
+               });
+
                public void EndConnect (IAsyncResult result)
                {
                        ThrowIfDisposedAndClosed ();
@@ -1513,7 +1613,7 @@ namespace System.Net.Sockets
 
                        SocketAsyncResult sockares = CreateSocketAsyncResultFromSocketAsyncEventArgs (e, SocketOperation.Disconnect, e.DisconnectCallback);
 
-                       IOSelector.Add (sockares.handle, new IOSelectorJob (IOOperation.Write, s => ((SocketAsyncResult) s).Worker.Disconnect (), sockares));
+                       IOSelector.Add (sockares.handle, new IOSelectorJob (IOOperation.Write, BeginDisconnectCallback, sockares));
 
                        return true;
                }
@@ -1527,11 +1627,24 @@ namespace System.Net.Sockets
                                ReuseSocket = reuseSocket,
                        };
 
-                       IOSelector.Add (sockares.handle, new IOSelectorJob (IOOperation.Write, s => ((SocketAsyncResult) s).Worker.Disconnect (), sockares));
+                       IOSelector.Add (sockares.handle, new IOSelectorJob (IOOperation.Write, BeginDisconnectCallback, sockares));
 
                        return sockares;
                }
 
+               static IOAsyncCallback BeginDisconnectCallback = new IOAsyncCallback (ares => {
+                       SocketAsyncResult sockares = (SocketAsyncResult) ares;
+
+                       try {
+                               sockares.socket.Disconnect (sockares.ReuseSocket);
+                       } catch (Exception e) {
+                               sockares.Complete (e);
+                               return;
+                       }
+
+                       sockares.Complete ();
+               });
+
                public void EndDisconnect (IAsyncResult asyncResult)
                {
                        ThrowIfDisposedAndClosed ();
@@ -1714,14 +1827,16 @@ namespace System.Net.Sockets
                        if (e.Buffer == null) {
                                sockares = CreateSocketAsyncResultFromSocketAsyncEventArgs (e, SocketOperation.ReceiveGeneric, e.ReceiveCallback);
                                sockares.Buffers = e.BufferList;
+
+                               QueueIOSelectorJob (readQ, sockares.handle, new IOSelectorJob (IOOperation.Read, BeginReceiveGenericCallback, sockares));
                        } else {
                                sockares = CreateSocketAsyncResultFromSocketAsyncEventArgs (e, SocketOperation.Receive, e.ReceiveCallback);
                                sockares.Buffer = e.Buffer;
                                sockares.Offset = e.Offset;
                                sockares.Size = e.Count;
-                       }
 
-                       QueueIOSelectorJob (readQ, sockares.handle, new IOSelectorJob (IOOperation.Read, s => ((SocketAsyncResult) s).Worker.Receive (), sockares));
+                               QueueIOSelectorJob (readQ, sockares.handle, new IOSelectorJob (IOOperation.Read, BeginReceiveCallback, sockares));
+                       }
 
                        return true;
                }
@@ -1739,7 +1854,7 @@ namespace System.Net.Sockets
                                SockFlags = socket_flags,
                        };
 
-                       QueueIOSelectorJob (readQ, sockares.handle, new IOSelectorJob (IOOperation.Read, s => ((SocketAsyncResult) s).Worker.Receive (), sockares));
+                       QueueIOSelectorJob (readQ, sockares.handle, new IOSelectorJob (IOOperation.Read, BeginReceiveCallback, sockares));
 
                        return sockares;
                }
@@ -1753,6 +1868,20 @@ namespace System.Net.Sockets
                        return BeginReceive (buffer, offset, size, flags, callback, state);
                }
 
+               static IOAsyncCallback BeginReceiveCallback = new IOAsyncCallback (ares => {
+                       SocketAsyncResult sockares = (SocketAsyncResult) ares;
+                       int total = 0;
+
+                       try {
+                               total = Receive_internal (sockares.socket.safe_handle, sockares.Buffer, sockares.Offset, sockares.Size, sockares.SockFlags, out sockares.error);
+                       } catch (Exception e) {
+                               sockares.Complete (e);
+                               return;
+                       }
+
+                       sockares.Complete (total);
+               });
+
                [CLSCompliant (false)]
                public IAsyncResult BeginReceive (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, AsyncCallback callback, object state)
                {
@@ -1766,7 +1895,7 @@ namespace System.Net.Sockets
                                SockFlags = socketFlags,
                        };
 
-                       QueueIOSelectorJob (readQ, sockares.handle, new IOSelectorJob (IOOperation.Read, s => ((SocketAsyncResult) s).Worker.Receive (), sockares));
+                       QueueIOSelectorJob (readQ, sockares.handle, new IOSelectorJob (IOOperation.Read, BeginReceiveGenericCallback, sockares));
 
                        return sockares;
                }
@@ -1779,6 +1908,20 @@ namespace System.Net.Sockets
                        return BeginReceive (buffers, socketFlags, callback, state);
                }
 
+               static IOAsyncCallback BeginReceiveGenericCallback = new IOAsyncCallback (ares => {
+                       SocketAsyncResult sockares = (SocketAsyncResult) ares;
+                       int total = 0;
+
+                       try {
+                               total = sockares.socket.Receive (sockares.Buffers, sockares.SockFlags);
+                       } catch (Exception e) {
+                               sockares.Complete (e);
+                               return;
+                       }
+
+                       sockares.Complete (total);
+               });
+
                public int EndReceive (IAsyncResult result)
                {
                        SocketError error;
@@ -1810,7 +1953,7 @@ namespace System.Net.Sockets
                        return sockares.Total;
                }
 
-               internal int Receive_nochecks (byte [] buf, int offset, int size, SocketFlags flags, out SocketError error)
+               int Receive_nochecks (byte [] buf, int offset, int size, SocketFlags flags, out SocketError error)
                {
                        int nativeError;
                        int ret = Receive_internal (safe_handle, buf, offset, size, flags, out nativeError);
@@ -1839,7 +1982,7 @@ namespace System.Net.Sockets
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
                extern static int Receive_internal (IntPtr sock, WSABUF[] bufarray, SocketFlags flags, out int error);
 
-               internal static int Receive_internal (SafeSocketHandle safeHandle, byte[] buffer, int offset, int count, SocketFlags flags, out int error)
+               static int Receive_internal (SafeSocketHandle safeHandle, byte[] buffer, int offset, int count, SocketFlags flags, out int error)
                {
                        try {
                                safeHandle.RegisterForBlockingSyscall ();
@@ -1860,24 +2003,16 @@ namespace System.Net.Sockets
                {
                        ThrowIfDisposedAndClosed ();
                        ThrowIfBufferNull (buffer);
-                       ThrowIfBufferOutOfRange (buffer, 0, buffer.Length);
-
-                       if (remoteEP == null)
-                               throw new ArgumentNullException ("remoteEP");
 
-                       return ReceiveFrom_nochecks (buffer, 0, buffer.Length, SocketFlags.None, ref remoteEP);
+                       return ReceiveFrom (buffer, 0, buffer.Length, SocketFlags.None, ref remoteEP);
                }
 
                public int ReceiveFrom (byte [] buffer, SocketFlags flags, ref EndPoint remoteEP)
                {
                        ThrowIfDisposedAndClosed ();
                        ThrowIfBufferNull (buffer);
-                       ThrowIfBufferOutOfRange (buffer, 0, buffer.Length);
 
-                       if (remoteEP == null)
-                               throw new ArgumentNullException ("remoteEP");
-
-                       return ReceiveFrom_nochecks (buffer, 0, buffer.Length, flags, ref remoteEP);
+                       return ReceiveFrom (buffer, 0, buffer.Length, flags, ref remoteEP);
                }
 
                public int ReceiveFrom (byte [] buffer, int size, SocketFlags flags, ref EndPoint remoteEP)
@@ -1886,10 +2021,7 @@ namespace System.Net.Sockets
                        ThrowIfBufferNull (buffer);
                        ThrowIfBufferOutOfRange (buffer, 0, size);
 
-                       if (remoteEP == null)
-                               throw new ArgumentNullException ("remoteEP");
-
-                       return ReceiveFrom_nochecks (buffer, 0, size, flags, ref remoteEP);
+                       return ReceiveFrom (buffer, 0, size, flags, ref remoteEP);
                }
 
                public int ReceiveFrom (byte [] buffer, int offset, int size, SocketFlags flags, ref EndPoint remoteEP)
@@ -1901,7 +2033,8 @@ namespace System.Net.Sockets
                        if (remoteEP == null)
                                throw new ArgumentNullException ("remoteEP");
 
-                       return ReceiveFrom_nochecks (buffer, offset, size, flags, ref remoteEP);
+                       int error;
+                       return ReceiveFrom_nochecks_exc (buffer, offset, size, flags, ref remoteEP, true, out error);
                }
 
                public bool ReceiveFromAsync (SocketAsyncEventArgs e)
@@ -1922,7 +2055,7 @@ namespace System.Net.Sockets
                        sockares.EndPoint = e.RemoteEndPoint;
                        sockares.SockFlags = e.SocketFlags;
 
-                       QueueIOSelectorJob (readQ, sockares.handle, new IOSelectorJob (IOOperation.Read, s => ((SocketAsyncResult) s).Worker.ReceiveFrom (), sockares));
+                       QueueIOSelectorJob (readQ, sockares.handle, new IOSelectorJob (IOOperation.Read, BeginReceiveFromCallback, sockares));
 
                        return true;
                }
@@ -1944,11 +2077,26 @@ namespace System.Net.Sockets
                                EndPoint = remote_end,
                        };
 
-                       QueueIOSelectorJob (readQ, sockares.handle, new IOSelectorJob (IOOperation.Read, s => ((SocketAsyncResult) s).Worker.ReceiveFrom (), sockares));
+                       QueueIOSelectorJob (readQ, sockares.handle, new IOSelectorJob (IOOperation.Read, BeginReceiveFromCallback, sockares));
 
                        return sockares;
                }
 
+               static IOAsyncCallback BeginReceiveFromCallback = new IOAsyncCallback (ares => {
+                       SocketAsyncResult sockares = (SocketAsyncResult) ares;
+                       int total = 0;
+
+                       try {
+                               int error;
+                               total = sockares.socket.ReceiveFrom_nochecks_exc (sockares.Buffer, sockares.Offset, sockares.Size, sockares.SockFlags, ref sockares.EndPoint, true, out error);
+                       } catch (Exception e) {
+                               sockares.Complete (e);
+                               return;
+                       }
+
+                       sockares.Complete (total);
+               });
+
                public int EndReceiveFrom(IAsyncResult result, ref EndPoint end_point)
                {
                        ThrowIfDisposedAndClosed ();
@@ -1968,12 +2116,6 @@ namespace System.Net.Sockets
                        return sockares.Total;
                }
 
-               internal int ReceiveFrom_nochecks (byte [] buf, int offset, int size, SocketFlags flags, ref EndPoint remote_end)
-               {
-                       int error;
-                       return ReceiveFrom_nochecks_exc (buf, offset, size, flags, ref remote_end, true, out error);
-               }
-
                internal int ReceiveFrom_nochecks_exc (byte [] buf, int offset, int size, SocketFlags flags, ref EndPoint remote_end, bool throwOnError, out int error)
                {
                        SocketAddress sockaddr = remote_end.Serialize();
@@ -2219,7 +2361,7 @@ namespace System.Net.Sockets
                        return ret;
                }
 
-               internal int Send_nochecks (byte [] buf, int offset, int size, SocketFlags flags, out SocketError error)
+               int Send_nochecks (byte [] buf, int offset, int size, SocketFlags flags, out SocketError error)
                {
                        if (size == 0) {
                                error = SocketError.Success;
@@ -2255,14 +2397,16 @@ namespace System.Net.Sockets
                        if (e.Buffer == null) {
                                sockares = CreateSocketAsyncResultFromSocketAsyncEventArgs (e, SocketOperation.SendGeneric, e.SendCallback);
                                sockares.Buffers = e.BufferList;
+
+                               QueueIOSelectorJob (writeQ, sockares.handle, new IOSelectorJob (IOOperation.Write, BeginSendGenericCallback, sockares));
                        } else {
                                sockares = CreateSocketAsyncResultFromSocketAsyncEventArgs (e, SocketOperation.Send, e.SendCallback);
                                sockares.Buffer = e.Buffer;
                                sockares.Offset = e.Offset;
                                sockares.Size = e.Count;
-                       }
 
-                       QueueIOSelectorJob (writeQ, sockares.handle, new IOSelectorJob (IOOperation.Write, s => ((SocketAsyncResult) s).Worker.Send (), sockares));
+                               QueueIOSelectorJob (writeQ, sockares.handle, new IOSelectorJob (IOOperation.Write, s => BeginSendCallback ((SocketAsyncResult) s, 0), sockares));
+                       }
 
                        return true;
                }
@@ -2294,11 +2438,43 @@ namespace System.Net.Sockets
                                SockFlags = socket_flags,
                        };
 
-                       QueueIOSelectorJob (writeQ, sockares.handle, new IOSelectorJob (IOOperation.Write, s => ((SocketAsyncResult) s).Worker.Send (), sockares));
+                       QueueIOSelectorJob (writeQ, sockares.handle, new IOSelectorJob (IOOperation.Write, s => BeginSendCallback ((SocketAsyncResult) s, 0), sockares));
 
                        return sockares;
                }
 
+               static void BeginSendCallback (SocketAsyncResult sockares, int sent_so_far)
+               {
+                       int total = 0;
+
+                       try {
+                               total = Socket.Send_internal (sockares.socket.safe_handle, sockares.Buffer, sockares.Offset, sockares.Size, sockares.SockFlags, out sockares.error);
+                       } catch (Exception e) {
+                               sockares.Complete (e);
+                               return;
+                       }
+
+                       if (sockares.error == 0) {
+                               sent_so_far += total;
+                               sockares.Offset += total;
+                               sockares.Size -= total;
+
+                               if (sockares.socket.is_disposed) {
+                                       sockares.Complete (total);
+                                       return;
+                               }
+
+                               if (sockares.Size > 0) {
+                                       IOSelector.Add (sockares.handle, new IOSelectorJob (IOOperation.Write, s => BeginSendCallback ((SocketAsyncResult) s, sent_so_far), sockares));
+                                       return; // Have to finish writing everything. See bug #74475.
+                               }
+
+                               sockares.Total = sent_so_far;
+                       }
+
+                       sockares.Complete (total);
+               }
+
                public IAsyncResult BeginSend (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, AsyncCallback callback, object state)
                {
                        ThrowIfDisposedAndClosed ();
@@ -2313,7 +2489,7 @@ namespace System.Net.Sockets
                                SockFlags = socketFlags,
                        };
 
-                       QueueIOSelectorJob (writeQ, sockares.handle, new IOSelectorJob (IOOperation.Write, s => ((SocketAsyncResult) s).Worker.SendGeneric (), sockares));
+                       QueueIOSelectorJob (writeQ, sockares.handle, new IOSelectorJob (IOOperation.Write, BeginSendGenericCallback, sockares));
 
                        return sockares;
                }
@@ -2330,6 +2506,20 @@ namespace System.Net.Sockets
                        return BeginSend (buffers, socketFlags, callback, state);
                }
 
+               static IOAsyncCallback BeginSendGenericCallback = new IOAsyncCallback (ares => {
+                       SocketAsyncResult sockares = (SocketAsyncResult) ares;
+                       int total = 0;
+
+                       try {
+                               total = sockares.socket.Send (sockares.Buffers, sockares.SockFlags);
+                       } catch (Exception e) {
+                               sockares.Complete (e);
+                               return;
+                       }
+
+                       sockares.Complete (total);
+               });
+
                public int EndSend (IAsyncResult result)
                {
                        SocketError error;
@@ -2376,7 +2566,7 @@ namespace System.Net.Sockets
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
                extern static int Send_internal (IntPtr sock, WSABUF[] bufarray, SocketFlags flags, out int error);
 
-               internal static int Send_internal (SafeSocketHandle safeHandle, byte[] buf, int offset, int count, SocketFlags flags, out int error)
+               static int Send_internal (SafeSocketHandle safeHandle, byte[] buf, int offset, int count, SocketFlags flags, out int error)
                {
                        try {
                                safeHandle.RegisterForBlockingSyscall ();
@@ -2397,36 +2587,21 @@ namespace System.Net.Sockets
                {
                        ThrowIfDisposedAndClosed ();
                        ThrowIfBufferNull (buffer);
-                       ThrowIfBufferOutOfRange (buffer, 0, buffer.Length);
 
-                       if (remote_end == null)
-                               throw new ArgumentNullException ("remote_end");
-
-                       return SendTo_nochecks (buffer, 0, buffer.Length, SocketFlags.None, remote_end);
+                       return SendTo (buffer, 0, buffer.Length, SocketFlags.None, remote_end);
                }
 
                public int SendTo (byte [] buffer, SocketFlags flags, EndPoint remote_end)
                {
                        ThrowIfDisposedAndClosed ();
                        ThrowIfBufferNull (buffer);
-                       ThrowIfBufferOutOfRange (buffer, 0, buffer.Length);
 
-                       if (remote_end == null)
-                               throw new ArgumentNullException ("remote_end");
-
-                       return SendTo_nochecks (buffer, 0, buffer.Length, flags, remote_end);
+                       return SendTo (buffer, 0, buffer.Length, flags, remote_end);
                }
 
                public int SendTo (byte [] buffer, int size, SocketFlags flags, EndPoint remote_end)
                {
-                       ThrowIfDisposedAndClosed ();
-                       ThrowIfBufferNull (buffer);
-                       ThrowIfBufferOutOfRange (buffer, 0, size);
-
-                       if (remote_end == null)
-                               throw new ArgumentNullException ("remote_end");
-
-                       return SendTo_nochecks (buffer, 0, size, flags, remote_end);
+                       return SendTo (buffer, 0, size, flags, remote_end);
                }
 
                public int SendTo (byte [] buffer, int offset, int size, SocketFlags flags, EndPoint remote_end)
@@ -2441,25 +2616,6 @@ namespace System.Net.Sockets
                        return SendTo_nochecks (buffer, offset, size, flags, remote_end);
                }
 
-               internal int SendTo_nochecks (byte [] buffer, int offset, int size, SocketFlags flags, EndPoint remote_end)
-               {
-                       int error;
-                       int ret = SendTo_internal (safe_handle, buffer, offset, size, flags, remote_end.Serialize (), out error);
-
-                       SocketError err = (SocketError) error;
-                       if (err != 0) {
-                               if (err != SocketError.WouldBlock && err != SocketError.InProgress)
-                                       is_connected = false;
-                               throw new SocketException (error);
-                       }
-
-                       is_connected = true;
-                       is_bound = true;
-                       seed_endpoint = remote_end;
-
-                       return ret;
-               }
-
                public bool SendToAsync (SocketAsyncEventArgs e)
                {
                        // NO check is made whether e != null in MS.NET (NRE is thrown in such case)
@@ -2479,7 +2635,7 @@ namespace System.Net.Sockets
                        sockares.SockFlags = e.SocketFlags;
                        sockares.EndPoint = e.RemoteEndPoint;
 
-                       QueueIOSelectorJob (writeQ, sockares.handle, new IOSelectorJob (IOOperation.Write, s => ((SocketAsyncResult) s).Worker.SendTo (), sockares));
+                       QueueIOSelectorJob (writeQ, sockares.handle, new IOSelectorJob (IOOperation.Write, s => BeginSendToCallback ((SocketAsyncResult) s, 0), sockares));
 
                        return true;
                }
@@ -2499,11 +2655,37 @@ namespace System.Net.Sockets
                                EndPoint = remote_end,
                        };
 
-                       QueueIOSelectorJob (writeQ, sockares.handle, new IOSelectorJob (IOOperation.Write, s => ((SocketAsyncResult) s).Worker.SendTo (), sockares));
+                       QueueIOSelectorJob (writeQ, sockares.handle, new IOSelectorJob (IOOperation.Write, s => BeginSendToCallback ((SocketAsyncResult) s, 0), sockares));
 
                        return sockares;
                }
 
+               static void BeginSendToCallback (SocketAsyncResult sockares, int sent_so_far)
+               {
+                       int total = 0;
+                       try {
+                               total = sockares.socket.SendTo_nochecks (sockares.Buffer, sockares.Offset, sockares.Size, sockares.SockFlags, sockares.EndPoint);
+
+                               if (sockares.error == 0) {
+                                       sent_so_far += total;
+                                       sockares.Offset += total;
+                                       sockares.Size -= total;
+                               }
+
+                               if (sockares.Size > 0) {
+                                       IOSelector.Add (sockares.handle, new IOSelectorJob (IOOperation.Write, s => BeginSendToCallback ((SocketAsyncResult) s, sent_so_far), sockares));
+                                       return; // Have to finish writing everything. See bug #74475.
+                               }
+
+                               sockares.Total = sent_so_far;
+                       } catch (Exception e) {
+                               sockares.Complete (e);
+                               return;
+                       }
+
+                       sockares.Complete ();
+               }
+
                public int EndSendTo (IAsyncResult result)
                {
                        ThrowIfDisposedAndClosed ();
@@ -2518,6 +2700,25 @@ namespace System.Net.Sockets
                        return sockares.Total;
                }
 
+               int SendTo_nochecks (byte [] buffer, int offset, int size, SocketFlags flags, EndPoint remote_end)
+               {
+                       int error;
+                       int ret = SendTo_internal (safe_handle, buffer, offset, size, flags, remote_end.Serialize (), out error);
+
+                       SocketError err = (SocketError) error;
+                       if (err != 0) {
+                               if (err != SocketError.WouldBlock && err != SocketError.InProgress)
+                                       is_connected = false;
+                               throw new SocketException (error);
+                       }
+
+                       is_connected = true;
+                       is_bound = true;
+                       seed_endpoint = remote_end;
+
+                       return ret;
+               }
+
                static int SendTo_internal (SafeSocketHandle safeHandle, byte[] buffer, int offset, int count, SocketFlags flags, SocketAddress sa, out int error)
                {
                        try {
@@ -3107,12 +3308,8 @@ namespace System.Net.Sockets
 
                SocketAsyncResult CreateSocketAsyncResultFromSocketAsyncEventArgs (SocketAsyncEventArgs e, SocketOperation op, AsyncCallback callback)
                {
-                       SocketAsyncResult sockares = new SocketAsyncResult (this, s => SocketAsyncEventArgsCallback (callback, s), e, op, null);
-                       SocketAsyncWorker worker = new SocketAsyncWorker (sockares);
-
-                       sockares.Worker = worker;
+                       SocketAsyncResult sockares = new SocketAsyncResult (this, s => SocketAsyncEventArgsCallback (callback, s), e, op);
 
-                       e.Worker = sockares.Worker;
                        e.curSocket = this;
                        e.SetLastOperation (SocketOperationToSocketAsyncOperation (op));
                        e.SocketError = SocketError.Success;
index 35b73d769f33a8ed3ffa2d0013fd218b0f39fbdf..4abc023bee046d7324f74bb6a4e056b34de81cd5 100644 (file)
@@ -40,7 +40,6 @@ namespace System.Net.Sockets
        {
                bool disposed;
                internal int in_progress;
-               internal SocketAsyncWorker Worker;
                EndPoint remote_ep;
                public Exception ConnectByNameError { get; internal set; }
 
@@ -101,7 +100,6 @@ namespace System.Net.Sockets
                
                public SocketAsyncEventArgs ()
                {
-                       Worker = new SocketAsyncWorker (this);
                        AcceptSocket = null;
                        Buffer = null;
                        BufferList = null;
@@ -133,10 +131,6 @@ namespace System.Net.Sockets
                        if (disposing) {
                                if (disposed || Interlocked.CompareExchange (ref in_progress, 0, 0) != 0)
                                        return;
-                               if (Worker != null) {
-                                       Worker.Dispose ();
-                                       Worker = null;
-                               }
                        }
                        AcceptSocket = null;
                        Buffer = null;
index fbf6e06b2b70205f09c4c6ef83b5d558927e95d7..1473c23f40da3a01a6553b4fd253e62a7b15194a 100644 (file)
@@ -55,16 +55,13 @@ namespace System.Net.Sockets
                public bool ReuseSocket;                  // Disconnect
                public int CurrentAddress;                // Connect
 
-               // Return values
-               Socket accept_socket;
-               int total;
+               public Socket AcceptedSocket;
+               public int Total;
 
                internal int error;
 
                public int EndCalled;
 
-               public SocketAsyncWorker Worker;
-
                public SocketAsyncResult ()
                        : base (null, null)
                {
@@ -76,29 +73,6 @@ namespace System.Net.Sockets
                        this.socket = socket;
                        this.handle = socket != null ? socket.Handle : IntPtr.Zero;
                        this.operation = operation;
-
-                       Worker = new SocketAsyncWorker (this);
-               }
-
-               public SocketAsyncResult (Socket socket, AsyncCallback callback, object state, SocketOperation operation, SocketAsyncWorker worker)
-                       : base (callback, state)
-               {
-                       this.socket = socket;
-                       this.handle = socket != null ? socket.Handle : IntPtr.Zero;
-                       this.operation = operation;
-
-                       Worker = worker;
-               }
-
-               public Socket Socket {
-                       get {
-                               return accept_socket;
-                       }
-               }
-
-               public int Total {
-                       get { return total; }
-                       set { total = value; }
                }
 
                public SocketError ErrorCode {
@@ -114,10 +88,6 @@ namespace System.Net.Sockets
                        }
                }
 
-               public void Dispose ()
-               {
-               }
-
                public void CheckIfThrowDelayedException ()
                {
                        if (DelayedException != null) {
@@ -195,7 +165,7 @@ namespace System.Net.Sockets
 
                public void Complete (int total)
                {
-                       this.total = total;
+                       Total = total;
                        Complete ();
                }
 
@@ -214,14 +184,14 @@ namespace System.Net.Sockets
 
                public void Complete (Socket s)
                {
-                       this.accept_socket = s;
+                       AcceptedSocket = s;
                        Complete ();
                }
 
                public void Complete (Socket s, int total)
                {
-                       this.accept_socket = s;
-                       this.total = total;
+                       AcceptedSocket = s;
+                       Total = total;
                        Complete ();
                }
        }
diff --git a/mcs/class/System/System.Net.Sockets/SocketAsyncWorker.cs b/mcs/class/System/System.Net.Sockets/SocketAsyncWorker.cs
deleted file mode 100644 (file)
index 557bc8f..0000000
+++ /dev/null
@@ -1,299 +0,0 @@
-// System.Net.Sockets.SocketAsyncWorker.cs
-//
-// Authors:
-//     Ludovic Henry <ludovic@xamarin.com>
-//
-// Copyright (C) 2015 Xamarin, Inc. (https://www.xamarin.com)
-//
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Threading;
-
-namespace System.Net.Sockets
-{
-       internal sealed class SocketAsyncWorker
-       {
-               public SocketAsyncResult result;
-               SocketAsyncEventArgs args;
-
-               public SocketAsyncWorker (SocketAsyncEventArgs args)
-               {
-                       this.args = args;
-                       result = new SocketAsyncResult ();
-                       result.Worker = this;
-               }
-
-               public SocketAsyncWorker (SocketAsyncResult ares)
-               {
-                       this.result = ares;
-               }
-
-               public void Dispose ()
-               {
-                       if (result != null) {
-                               result.Dispose ();
-                               result = null;
-                               args = null;
-                       }
-               }
-
-               public void Accept ()
-               {
-                       Socket acc_socket = null;
-                       try {
-                               if (args != null && args.AcceptSocket != null) {
-                                       result.socket.Accept (args.AcceptSocket);
-                                       acc_socket = args.AcceptSocket;
-                               } else {
-                                       acc_socket = result.socket.Accept ();
-                                       if (args != null)
-                                               args.AcceptSocket = acc_socket;
-                               }
-                       } catch (Exception e) {
-                               result.Complete (e);
-                               return;
-                       }
-
-                       result.Complete (acc_socket);
-               }
-
-               /* only used in 2.0 profile and newer, but
-                * leave in older profiles to keep interface
-                * to runtime consistent
-                */
-               public void AcceptReceive ()
-               {
-                       Socket acc_socket = null;
-                       try {
-                               if (result.AcceptSocket == null) {
-                                       acc_socket = result.socket.Accept ();
-                               } else {
-                                       acc_socket = result.AcceptSocket;
-                                       result.socket.Accept (acc_socket);
-                               }
-                       } catch (Exception e) {
-                               result.Complete (e);
-                               return;
-                       }
-
-                       /* It seems the MS runtime
-                        * special-cases 0-length requested
-                        * receive data.  See bug 464201.
-                        */
-                       int total = 0;
-                       if (result.Size > 0) {
-                               try {
-                                       SocketError error;
-                                       total = acc_socket.Receive_nochecks (result.Buffer, result.Offset, result.Size, result.SockFlags, out error);
-                                       if (error != 0) {
-                                               result.Complete (new SocketException ((int) error));
-                                               return;
-                                       }
-                               } catch (Exception e) {
-                                       result.Complete (e);
-                                       return;
-                               }
-                       }
-
-                       result.Complete (acc_socket, total);
-               }
-
-               public void Connect ()
-               {
-                       if (result.EndPoint == null) {
-                               result.Complete (new SocketException ((int)SocketError.AddressNotAvailable));
-                               return;
-                       }
-
-                       SocketAsyncResult mconnect = result.AsyncState as SocketAsyncResult;
-                       bool is_mconnect = (mconnect != null && mconnect.Addresses != null);
-                       try {
-                               int error_code;
-                               EndPoint ep = result.EndPoint;
-                               error_code = (int) result.socket.GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Error);
-                               if (error_code == 0) {
-                                       if (is_mconnect)
-                                               result = mconnect;
-                                       result.socket.seed_endpoint = ep;
-                                       result.socket.is_connected = true;
-                                       result.socket.is_bound = true;
-                                       result.socket.connect_in_progress = false;
-                                       result.error = 0;
-                                       result.Complete ();
-                                       return;
-                               }
-
-                               if (!is_mconnect) {
-                                       result.socket.connect_in_progress = false;
-                                       result.Complete (new SocketException (error_code));
-                                       return;
-                               }
-
-                               if (mconnect.CurrentAddress >= mconnect.Addresses.Length) {
-                                       mconnect.Complete (new SocketException (error_code));
-                                       return;
-                               }
-                               mconnect.socket.BeginMConnect (mconnect);
-                       } catch (Exception e) {
-                               result.socket.connect_in_progress = false;
-                               if (is_mconnect)
-                                       result = mconnect;
-                               result.Complete (e);
-                               return;
-                       }
-               }
-
-               /* Also only used in 2.0 profile and newer */
-               public void Disconnect ()
-               {
-                       try {
-                               if (args != null)
-                                       result.ReuseSocket = args.DisconnectReuseSocket;
-                               result.socket.Disconnect (result.ReuseSocket);
-                       } catch (Exception e) {
-                               result.Complete (e);
-                               return;
-                       }
-                       result.Complete ();
-               }
-
-               public void Receive ()
-               {
-                       if (result.operation == SocketOperation.ReceiveGeneric) {
-                               ReceiveGeneric ();
-                               return;
-                       }
-
-                       int total = 0;
-                       try {
-                               total = Socket.Receive_internal (result.socket.safe_handle, result.Buffer, result.Offset, result.Size, result.SockFlags, out result.error);
-                       } catch (Exception e) {
-                               result.Complete (e);
-                               return;
-                       }
-
-                       result.Complete (total);
-               }
-
-               public void ReceiveFrom ()
-               {
-                       int total = 0;
-                       try {
-                               total = result.socket.ReceiveFrom_nochecks (result.Buffer, result.Offset, result.Size, result.SockFlags, ref result.EndPoint);
-                       } catch (Exception e) {
-                               result.Complete (e);
-                               return;
-                       }
-
-                       result.Complete (total);
-               }
-
-               public void ReceiveGeneric ()
-               {
-                       int total = 0;
-                       try {
-                               total = result.socket.Receive (result.Buffers, result.SockFlags);
-                       } catch (Exception e) {
-                               result.Complete (e);
-                               return;
-                       }
-                       result.Complete (total);
-               }
-
-               int send_so_far;
-
-               void UpdateSendValues (int last_sent)
-               {
-                       if (result.error == 0) {
-                               send_so_far += last_sent;
-                               result.Offset += last_sent;
-                               result.Size -= last_sent;
-                       }
-               }
-
-               public void Send ()
-               {
-                       if (result.operation == SocketOperation.SendGeneric) {
-                               SendGeneric ();
-                               return;
-                       }
-
-                       int total = 0;
-                       try {
-                               total = Socket.Send_internal (result.socket.safe_handle, result.Buffer, result.Offset, result.Size, result.SockFlags, out result.error);
-                       } catch (Exception e) {
-                               result.Complete (e);
-                               return;
-                       }
-
-                       if (result.error == 0) {
-                               UpdateSendValues (total);
-                               if (result.socket.is_disposed) {
-                                       result.Complete (total);
-                                       return;
-                               }
-
-                               if (result.Size > 0) {
-                                       IOSelector.Add (result.handle, new IOSelectorJob (IOOperation.Write, s => ((SocketAsyncResult) s).Worker.Send (), result));
-                                       return; // Have to finish writing everything. See bug #74475.
-                               }
-                               result.Total = send_so_far;
-                               send_so_far = 0;
-                       }
-                       result.Complete (total);
-               }
-
-               public void SendTo ()
-               {
-                       int total = 0;
-                       try {
-                               total = result.socket.SendTo_nochecks (result.Buffer, result.Offset, result.Size, result.SockFlags, result.EndPoint);
-
-                               UpdateSendValues (total);
-                               if (result.Size > 0) {
-                                       IOSelector.Add (result.handle, new IOSelectorJob (IOOperation.Write, s => ((SocketAsyncResult) s).Worker.SendTo (), result));
-                                       return; // Have to finish writing everything. See bug #74475.
-                               }
-                               result.Total = send_so_far;
-                               send_so_far = 0;
-                       } catch (Exception e) {
-                               send_so_far = 0;
-                               result.Complete (e);
-                               return;
-                       }
-
-                       result.Complete ();
-               }
-
-               public void SendGeneric ()
-               {
-                       int total = 0;
-                       try {
-                               total = result.socket.Send (result.Buffers, result.SockFlags);
-                       } catch (Exception e) {
-                               result.Complete (e);
-                               return;
-                       }
-                       result.Complete (total);
-               }
-       }
-}
index 28f4515081b4f76c65d21a8cc838221e0144aaa1..79b9759069e87459caed737c3acfeddd9d47d97b 100644 (file)
@@ -439,7 +439,6 @@ System.Net.Sockets/SocketAsyncCallback.cs
 System.Net.Sockets/SocketAsyncEventArgs.cs
 System.Net.Sockets/SocketAsyncOperation.cs
 System.Net.Sockets/SocketAsyncResult.cs
-System.Net.Sockets/SocketAsyncWorker.cs
 System.Net.Sockets/SocketError.cs
 System.Net.Sockets/SocketException.cs
 System.Net.Sockets/SocketFlags.cs
index 52d2152c6ed778ffe8bce6610d3bc8a1cccba56c..73e29755a9e2d12729405d4b9cbafe0a287d67f3 100644 (file)
@@ -134,7 +134,6 @@ System.Net.Sockets/SocketAsyncCallback.cs
 System.Net.Sockets/SocketAsyncEventArgs.cs
 System.Net.Sockets/SocketAsyncOperation.cs
 System.Net.Sockets/SocketAsyncResult.cs
-System.Net.Sockets/SocketAsyncWorker.cs
 System.Net.Sockets/SocketError.cs
 System.Net.Sockets/SocketException.cs
 System.Net.Sockets/SocketFlags.cs