mkjeff / secs4net

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

Sometimes the message reading is incomplete. #85

Open eacanchen opened 1 year ago

eacanchen commented 1 year ago

<-- [0x000006B0] 'S6F11'W <L [3] <A [4] '9000'> <A [4] '8001'> <L [1] <L [2] <U2 [1] 801> <L [2] <A [4] 'test'> <A [3] 'eqp'>

.

--> [0x000006B0] 'S6F12' <B [1] 0x00> .

<-- [0x000006B1] 'S6F11'W <L [0]

.

--> [0x000006B1] 'S6F12' <B [1] 0x00> .

Unexpected exception on StartAsyncStreamDecoderAsync

System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. at Secs4Net.Item.g__ThrowHelper|4514(ReadOnlySequence`1& ) in //src/Secs4Net/Item.Decode.cs:line 457 at Secs4Net.PipeDecoder.DecodeLoopAsync(ChannelWriter1 controlMessageWriter, ChannelWriter1 dataMessageWriter, PipeReader reader, CancellationToken cancellation) in //src/Secs4Net/PipeDecoder.cs:line 159 at Secs4Net.HsmsConnection.StartPipeDecoderConsumerAsync(CancellationToken cancellation) in /_/src/Secs4Net/HsmsConnection.cs:line 261

wang9th commented 1 year ago

我也遇到了这个问题,你解决了吗?

eacanchen commented 1 year ago

解决了,尝试放大缓存区

wang9th commented 1 year ago

buffer size 设置为多少?会不会暂时测试不报错,长时间就会出现

wang9th commented 1 year ago

解决了,尝试放大缓存区 我 用 fastsim 与 这个项目 自带 的 样例 通讯时,buffer size 设置为 5120,他 不会立即出现问题,使用一段时间后才会出现

wang9th commented 1 year ago

解决了,尝试放大缓存区

放大缓冲区后你还遇到过这个问题吗?