Author: gonzalo
Date: 2005-04-03 23:45:57 -0400 (Sun, 03 Apr 2005)
New Revision: 42499

Modified:
   trunk/mcs/class/System/System.Net.Sockets/ChangeLog
   trunk/mcs/class/System/System.Net.Sockets/Socket.cs
Log:
2005-04-04 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>

        * Socket.cs: remove unused async IO code.



Modified: trunk/mcs/class/System/System.Net.Sockets/ChangeLog
===================================================================
--- trunk/mcs/class/System/System.Net.Sockets/ChangeLog 2005-04-03 17:24:50 UTC 
(rev 42498)
+++ trunk/mcs/class/System/System.Net.Sockets/ChangeLog 2005-04-04 03:45:57 UTC 
(rev 42499)
@@ -1,3 +1,7 @@
+2005-04-04 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+
+       * Socket.cs: remove unused async IO code.
+
 2005-03-01 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
 
        * Socket.cs: don't Poll/block in Connect aither.

Modified: trunk/mcs/class/System/System.Net.Sockets/Socket.cs
===================================================================
--- trunk/mcs/class/System/System.Net.Sockets/Socket.cs 2005-04-03 17:24:50 UTC 
(rev 42498)
+++ trunk/mcs/class/System/System.Net.Sockets/Socket.cs 2005-04-04 03:45:57 UTC 
(rev 42499)
@@ -327,7 +327,6 @@
                internal bool blocking=true;
                private int pendingEnds;
                private int closeDelayed;
-               static readonly bool supportsAsync = FakeGetSupportsAsync ();
 
                delegate void SocketAsyncCall ();
                /*
@@ -803,18 +802,9 @@
                        req.Offset = offset;
                        req.Size = size;
                        req.SockFlags = socket_flags;
-                       if (supportsAsync && socket_type == SocketType.Stream) {
-                               int error;
-                               req.CreateAsyncDelegate ();
-                               KeepReference (req);
-                               AsyncReceiveInternal (req, out error);
-                               if (error != 0 && error != 10036) // 
WSAEINPROGRESS
-                                       throw new SocketException (error);
-                       } else {
-                               Worker worker = new Worker (req);
-                               SocketAsyncCall sac = new SocketAsyncCall 
(worker.Receive);
-                               sac.BeginInvoke (null, null);
-                       }
+                       Worker worker = new Worker (req);
+                       SocketAsyncCall sac = new SocketAsyncCall 
(worker.Receive);
+                       sac.BeginInvoke (null, null);
 
                        return req;
                }
@@ -877,18 +867,9 @@
                        req.Offset = offset;
                        req.Size = size;
                        req.SockFlags = socket_flags;
-                       if (supportsAsync && socket_type == SocketType.Stream) {
-                               int error;
-                               req.CreateAsyncDelegate ();
-                               KeepReference (req);
-                               AsyncSendInternal (req, out error);
-                               if (error != 0 && error != 10036) // 
WSAEINPROGRESS
-                                       throw new SocketException (error);
-                       } else {
-                               Worker worker = new Worker (req);
-                               SocketAsyncCall sac = new SocketAsyncCall 
(worker.Send);
-                               sac.BeginInvoke (null, null);
-                       }
+                       Worker worker = new Worker (req);
+                       SocketAsyncCall sac = new SocketAsyncCall (worker.Send);
+                       sac.BeginInvoke (null, null);
                        return req;
                }
 
@@ -1033,9 +1014,6 @@
                        if (req == null)
                                throw new ArgumentException ("Invalid 
IAsyncResult", "result");
 
-                       if (supportsAsync && socket_type == SocketType.Stream)
-                               RemoveReference (req);
-
                        if (!result.IsCompleted)
                                result.AsyncWaitHandle.WaitOne();
 
@@ -1078,9 +1056,6 @@
                        if (req == null)
                                throw new ArgumentException ("Invalid 
IAsyncResult", "result");
 
-                       if (supportsAsync && socket_type == SocketType.Stream)
-                               RemoveReference (req);
-
                        if (!result.IsCompleted)
                                result.AsyncWaitHandle.WaitOne();
 
@@ -1692,45 +1667,6 @@
                ~Socket () {
                        Dispose(false);
                }
-
-               static Hashtable asyncObjects;
-
-               static void KeepReference (object o)
-               {
-                       lock (typeof (Socket)) {
-                               if (asyncObjects == null)
-                                       asyncObjects = new Hashtable ();
-
-                               asyncObjects [o] = o;
-                       }
-               }
-
-               static void RemoveReference (object o)
-               {
-                       lock (typeof (Socket)) {
-                               if (asyncObjects == null)
-                                       return;
-
-                               asyncObjects.Remove (o);
-                       }
-               }
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               extern static bool GetSupportsAsync ();
-
-               static bool FakeGetSupportsAsync ()
-               {
-                       if (Environment.GetEnvironmentVariable 
("MONO_ENABLE_SOCKET_AIO") != null)
-                               return GetSupportsAsync ();
-                       
-                       return false;
-               }
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               extern static void AsyncReceiveInternal (SocketAsyncResult 
ares, out int error);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               extern static void AsyncSendInternal (SocketAsyncResult ares, 
out int error);
        }
 }
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to