Closed kelvinMyh closed 3 years ago
The list data items in SecsMessage are limited up to 255 elements. It may be a reason why the program did crash.
I ran into this issue (or at least something similar) and was able to get a workaround. I was receiving a reply message that was very big (list of >55000). Problem was, the ReceiveBufferSize in the SecsGem class was too small. I am not a creator of the SW I am working on, so I cannot give code snippets.
But if you change the ReceiveBufferSize for the socket to accommodate your data on instantiation, it should continue to work.
it should continue to work.
Thank you very much!
kelvin,can you share how to start up EAP Host
BinaryAssault, I meant there is a hardcoded limitation in secs4net. It's just not possible to add to a message a list with more than 255 elements, because the library throws an exception.
private Item(IReadOnlyList<Item> items) { if (items.Count > byte.MaxValue) throw new ArgumentOutOfRangeException(nameof(items) + "." + nameof(items.Count), items.Count, @"List items length out of range, max length: 255"); ... }
But array item length isn't limited.
Well the issue is in the type, where the 2 last Bits determine the size of the length value. Secs supports up to 3 Byte for length value. Secs4Net only ever uses 1 Byte.
The issue should mostly be within the Item class.
If no one else will fix this. I will. But not within the next month. I currently don't got the time.
I have created a pull request (#37), which fixes this issue.
Or have a look here: https://github.com/TiltonJH/secs4net
I have created a pull request (#37), which fixes this issue.
Or have a look here: https://github.com/TiltonJH/secs4net
Thanks!
hi Jeff I was running the EAPhost, after sending an S1F3 requesting all SVs, the eq replied with over 400 items, and after receiving the first buffer (0x4000 bytes), the program stopped responding to any action, and soon ended itself. I tried to use some try catches, but none break point in the exception section was spotted. appreciation for any reply.