SerialPortStream is an independent implementation of System.IO.Ports.SerialPort and SerialStream for better reliability and maintainability. Default branch is 2.x and now has support for Mono with help of a C library.
Microsoft Public License
614
stars
196
forks
source link
ReadBufferSize changes when Serialportstream is open #121
I set the readbuffer before opening the port. (version 2.3.1)
_serialStream = new SerialPortStream();
_serialStream.ReadBufferSize = 16384;
After a few minutes my parser gets an error on an Array copy method....
When this happens the debugger in VisualStudio shows that the _serialStream.ReadBufferSize has magically become 32768 bytes...
The stream was open the whole time, and I only set the size in my code once.
Does anyone have an idea how this is possible?
With the previous version of the SerialPortStream NuGet package It was working... (or the latest windows 10 update is to blame)
Thanks
--update I think I found the culprit, looks like the culprit was in a constructor of a derived class...
I set the readbuffer before opening the port. (version 2.3.1)
After a few minutes my parser gets an error on an Array copy method.... When this happens the debugger in VisualStudio shows that the _serialStream.ReadBufferSize has magically become 32768 bytes... The stream was open the whole time, and I only set the size in my code once.
Does anyone have an idea how this is possible?
With the previous version of the SerialPortStream NuGet package It was working... (or the latest windows 10 update is to blame)
Thanks
--update I think I found the culprit, looks like the culprit was in a constructor of a derived class...