[Mono-bugs] [Bug 77108][Nor] Changed - TextReader.Read from System.Console.In is incorrectly blocking

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon Jan 2 11:22:51 EST 2006


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by sebastien at ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=77108

--- shadow/77108	2006-01-02 10:00:56.000000000 -0500
+++ shadow/77108.tmp.32654	2006-01-02 11:22:51.000000000 -0500
@@ -5,13 +5,13 @@
 OS Details: 
 Status: NEW   
 Resolution: 
 Severity: Unknown
 Priority: Normal
 Component: CORLIB
-AssignedTo: mono-bugs at ximian.com                            
+AssignedTo: sebastien at ximian.com                            
 ReportedBy: jake4379 at fastmail.fm               
 QAContact: mono-bugs at ximian.com
 TargetMilestone: ---
 URL: 
 Cc: 
 Summary: TextReader.Read from System.Console.In is incorrectly blocking
@@ -61,6 +61,34 @@
 It doesn't look like a "traditional" blocking/non-blocking issue.
 
 MS "blocks" indefinitively but returns after the first new line.
 
 Mono doesn't consider the new line (probably because it use a
 FileStream) so it returns only when the buffer is full.
+
+------- Additional Comments From sebastien at ximian.com  2006-01-02 11:22 -------
+I added tests (r54954) for StreamReader and StringReader and their
+Read methods don't return when they encounter a new line. So this
+seems to be a console-only feature.
+
+Another similar test case (because a new line is 2 characters under
+Windows).
+
+using System;
+
+class M {
+	static void Main ()
+	{ 
+		char[] charbuf = new char[10];
+		int nRead = Console.In.Read(charbuf,0,10);
+		Console.WriteLine("1Read = {0}\n",nRead);
+		nRead = Console.In.Read(charbuf,0,10);
+		Console.WriteLine("2Read = {0}\n",nRead);
+	}
+}
+
+Type: "123456789" then Enter
+and you'll get
+1Read=10
+2Read=1
+
+so we must keep the NL logic between calls to Read.


More information about the mono-bugs mailing list