2008-09-06 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Fri, 5 Sep 2008 23:53:42 +0000 (23:53 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Fri, 5 Sep 2008 23:53:42 +0000 (23:53 -0000)
* Socket.cs : (SocketAsyncResult) release byte buffer early so that
  it does not have to store extra data in pool. Fixed bug #397627.

svn path=/trunk/mcs/; revision=112408

mcs/class/System/System.Net.Sockets/ChangeLog
mcs/class/System/System.Net.Sockets/Socket.cs

index 8344ca43f5fb166fa1a7090f6465b65f411f2686..7cca16e8f61fa3a81a424de0e0e982789040e149 100644 (file)
@@ -1,3 +1,8 @@
+2008-09-06  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * Socket.cs : (SocketAsyncResult) release byte buffer early so that
+         it does not have to store extra data in pool. Fixed bug #397627.
+
 2008-07-31  Jb Evain  <jbevain@novell.com>
 
        * Socket.cs
index 85ba9ab42baa3119d2319129bff56aa68e3c87f6..e91b04b0cf670c96e60cc35fcc340ea3a061bda9 100644 (file)
@@ -150,6 +150,8 @@ namespace System.Net.Sockets
                                        cb = new WaitCallback (ares.CompleteDisposed);
                                        ThreadPool.QueueUserWorkItem (cb, null);
                                }
+                               if (pending.Length == 0)
+                                       Buffer = null;
                        }
 
                        void CompleteDisposed (object unused)
@@ -193,6 +195,7 @@ namespace System.Net.Sockets
 
                                if (callback != null)
                                        callback (this);
+                               Buffer = null;
                        }
 
                        SocketAsyncCall GetDelegate (Worker worker, SocketOperation op)