Login  
Search All Forums
Dart Home | PowerSNMP for .NET | Custom Development Reply | PowerSNMP for .NET Topics | Forums   
AuthorForum: PowerSNMP for .NET
Topic: Value lost when deserializing UInteger
andershavn

From: Denmark
Posts: 16
Member Since: 01/07/14
posted March 7, 2014 9:27 AM

Hi,

I have a VariableList with two values:

var variableList = new VariableList();
   MibNode mibNode = _agent.Mib[Mibs.NodeName.networkMCC.ToString()];
   var uintVariable = new Variable(mibNode.Iid, new UInteger(8));
   variableList[mibNode.Iid] = uintVariable;

   mibNode = _agent.Mib[Mibs.NodeName.subscriberPIN.ToString()];
   var intVariable = new Variable(mibNode.Iid, new Integer(9));
   variableList[mibNode.Iid] = intVariable;

using (var file = new FileStream("TEST" + ".dat", FileMode.Create, FileAccess.Write))
    _agent.Serialize(variableList, file);

   VariableList decodedVariableList;
   using (var fs = new FileStream("TEST" + ".dat", FileMode.Open))
    decodedVariableList = (VariableList)_agent.Deserialize(fs);

After deserializing the value is 0 in the UInteger variable. The value in the Integer variable is restored correct.
This must be a bug?

Best Regards,
Anders Havn
andershavn

From: Denmark
Posts: 16
Member Since: 01/07/14
posted March 7, 2014 9:30 AM

One more note:

It works fine with OctetString, but it also fails with TimeTicks. Haven't tested the other types.

/Anders
Nick B (Admin)

From: Utica, NY USA
Posts: 576
Member Since: 05/25/10

Extra Support Options
Custom Application Development

posted March 7, 2014 11:36 AM

Hello Anders,

Thank you for your report, I've reproduced your issue and logged it as TFS437. For information and updates on its status, please contact jamie.powell@dart.com.

This affects the Counter, Gauge, TimeTicks, and UInteger SimpleTypes. For a workaround in the meantime, the SimpleType values may be stored manually by some alternative method in your application.
Reply | PowerSNMP for .NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX