mkjeff / secs4net

SECS-II/HSMS-SS/GEM implementation on .NET
https://mkjeff.github.io/secs4net/
MIT License
443 stars 195 forks source link

SecsDevice based on NET461/NET472 cannot send SecsItem which contains large array #64

Closed brucetju closed 2 years ago

brucetju commented 2 years ago

Describe the bug NET461/NET472 cannot send SecsItem which contains large array while NET5.0/6.0 works ok

To Reproduce Steps to reproduce the behavior:

  1. use secsDevice project, and change "btnSendPrimary_Click" func, original code is like this:[length of large array is 1136532, file size is about 1M, 200Kb file also tested, failed same.] image

  2. go to samples/SecsDevice/bin/Debug/net461;net472;net6.0-windows, open two same SecsDevice.exe window.

  3. set up one as active, another as passive. wait for selected status.

  4. click "send" button, net6.0 works correctly, net461/net472 error is like this: image image

Expected behavior net461/net472/net6.0 should act same for large array items.

Screenshots as previous.

Desktop (please complete the following information):

Could you help me on this issue?

mkjeff commented 2 years ago

the issue was leading by incorrect usage on ArrayPoolBufferWriter<T> , fixed in 8b554854c7907c2fa12f663618eedfbaa973b3a5

please upgrade to new version: 2.1.0