https://bugzilla.novell.com/show_bug.cgi?id=635971
https://bugzilla.novell.com/show_bug.cgi?id=635971#c0 Summary: SerialPort.ReadTimeout should accept Zero Classification: Mono Product: Mono: Class Libraries Version: 2.6.x Platform: x86-64 OS/Version: All Status: NEW Severity: Normal Priority: P5 - None Component: System AssignedTo: [email protected] ReportedBy: [email protected] QAContact: [email protected] Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100724 Firefox/3.6.8 SerialPort.ReadTimeout should accept a value of zero. This is an incompatibility between Mono and .Net. MSDN (http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.readtimeout.aspx) states that ArgumentOutOfRangeException is thrown when "The read time-out value is less than zero and not equal to InfiniteTimeout.". Thus, zero is accepted. When the test program is run on .Net, it is indeed accepted and no exception is thrown. Reproducible: Always Steps to Reproduce: using System; using System.IO.Ports; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { SerialPort COMport = new SerialPort("/dev/rfcomm0", 115200, Parity.None, 8, StopBits.One); COMport.ReadTimeout = 0; COMport.Open(); } } } Actual Results: Mono throws ArgumentOutOfRangeException when wirting the property with zero. Expected Results: No exception should be thrown. Instead, a timeout value of zero should mean "do not wait for a timeout, return immediately if there is no character in the receive buffer". The MSDN documentation is ambigouos. It states at a later point that "The time-out can be set to any value greater than zero, or set to InfiniteTimeout". This implies that zero is not accepted. However, both the exception documentation say that no exception is thrown on zero, and the .Net libraries also accept zero as a property value. This should be fixed to ensure compatibility with .Net. Also, correctly implementing a value of zero as "do not wait for a timeout, but return immediately if there is no character in the receive buffer", enhances functionality and versatility of the library. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug. You are the assignee for the bug. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
