Quantcast
Channel: C# Based Open Source SNMP Library for .NET and Mono
Viewing all articles
Browse latest Browse all 576

Commented Unassigned: ObjectStore order [7292]

$
0
0
I'm creating an snmp agent. When using the ObjectStore.GetNextObject method I don't always get the correct object. The only way to assure the correct object is returned is by adding them in order in the first place.
I noticed that the ObjectIdentifier implements the IComparable interface. Would it be a fix to change the implementation of GetNextObject to the following code?
(I'm using version 8.5)
```
public sealed class ObjectStore
{
...
public ScalarObject GetNextObject(ObjectIdentifier id)
{
return _list.Select(o => o.MatchGetNext(id))
.OrderBy(o => o.Variable.Id)
.FirstOrDefault(result => result != null);
}
...
}
```
Comments: Thanks for reporting it. I intentionally designed it this way, so as to force the agent authors to put objects in a nice order. Such a patch can hide potential issues, so I will not consider accepting it.

Viewing all articles
Browse latest Browse all 576

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>