Hello:


This patch fix a problem closing a bufferedstream that uses a networkstream, the problem gives when bufferedstream try to get the value of the property Position of the networkstream, this property on networkstream will throw always an exeption(this is correct).

The same thing with csc works well.




Best regards
Carlos Guzm�n �lvarez
Vigo-Spain



P.S.: I use GetType().FullName instead of is because using the last mcs don�t build.
Index: BufferedStream.cs
===================================================================
RCS file: /mono/mcs/class/corlib/System.IO/BufferedStream.cs,v
retrieving revision 1.2
diff -u -r1.2 BufferedStream.cs
--- BufferedStream.cs   8 May 2002 13:21:11 -0000       1.2
+++ BufferedStream.cs   20 Nov 2002 10:53:55 -0000
@@ -65,7 +65,9 @@
 
                public override void Flush() {
                        if (m_buffer_reading) {
-                               m_stream.Position = Position;
+                               if((m_stream.GetType().FullName != 
+"System.Net.Sockets.NetworkStream")){
+                                       m_stream.Position = Position;
+                               }
                        } else {
                                m_stream.Write(m_buffer, 0, m_buffer_pos);
                        }


Reply via email to