https://bugzilla.novell.com/show_bug.cgi?id=445519


           Summary: changing System.IO.Ports.SerialPort.ReadBufferSize
                    doesn't take effect
           Product: Mono: Class Libraries
           Version: 2.0
          Platform: 32bit
        OS/Version: openSUSE 11.0
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]
         QAContact: [email protected]
          Found By: Development


description:
------------
The following problem occurs on ubuntu 8.10 (mono 1.9.1) and openSUSE 11.0 live
cd with mono 2.0.1.

It doesn't matter to which value I set the ReadBufferSize. When I send data to
the serial port, the value of BytesToRead never becomes greater than 4095. So
the maximum amount of data which I can read at a time with Read(...) or
ReadExisting(...) is only 4095 bytes.


steps to reproduce:
-------------------
1) compile and run the following code:

using System;
using System.IO.Ports;
using System.Threading;

namespace SerialPortTest
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            SerialPort sp = new SerialPort("/dev/ttyS0");

            Console.WriteLine(sp.ReadBufferSize); // default: 4096 
            sp.ReadBufferSize = 100 * 1024; // 100 KiB
            Console.WriteLine(sp.ReadBufferSize); // now: 102400

            sp.Open();

            while (!Console.KeyAvailable)
            {
                Console.WriteLine(sp.BytesToRead);
                Thread.Sleep(1000);
            }

            sp.Close();
        }
    }
}

2) Send more than 4095 bytes to the port (e.g. over null-modem from another pc)
and watch how the BytesToRead value stops at 4095 byts.


-- 
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

Reply via email to