I am getting an error when running Get requests on a device and need to know what the error indicates. If I do a Walk using a MIB browser after I get this issue I can get all the data. It is only #SNMP that has an issue.
Details:
I am calling Messenger.Get using SNMP V1 and I am querying 24 SNMP objects.
Exception:
{"wrong response sequence: expected -1986527, received 14790689"}
StackTrace:
at Lextm.SharpSnmpLib.Messaging.SnmpMessageExtension.GetResponse(ISnmpMessage request, Int32 timeout, IPEndPoint receiver, UserRegistry registry, Socket udpSocket) in c:\sharpsnmplib\SharpSnmpLib\Messaging\SnmpMessageExtension.cs:line 440
at Lextm.SharpSnmpLib.Messaging.SnmpMessageExtension.GetResponse(ISnmpMessage request, Int32 timeout, IPEndPoint receiver, Socket udpSocket) in c:\sharpsnmplib\SharpSnmpLib\Messaging\SnmpMessageExtension.cs:line 355
at Lextm.SharpSnmpLib.Messaging.SnmpMessageExtension.GetResponse(ISnmpMessage request, Int32 timeout, IPEndPoint receiver) in c:\sharpsnmplib\SharpSnmpLib\Messaging\SnmpMessageExtension.cs:line 320
at Lextm.SharpSnmpLib.Messaging.Messenger.Get(VersionCode version, IPEndPoint endpoint, OctetString community, IList`1 variables, Int32 timeout) in c:\sharpsnmplib\SharpSnmpLib\Messaging\Messenger.cs:line 96
at Comms.Snmp.SharpSNMPDevice.ProcessSnmpGets() in z:\Projects\SES Astra\2400 Program\Software\Source\SESAstraServer\SESAstraServer\Comms\Snmp\SharpSNMPDevice.cs:line 892
Please advise.
Comments: Can you check `TestResponsesFromSingleSourceWithMultipleThreads` in this file, https://github.com/lextm/sharpsnmplib/blob/master/Tests/Messaging/Tests/GetRequestMessageTestFixture.cs The correct way to send multiple requests to a single agent is what this test case shows, by using a dedicate `Socket` object per threads. In that way each threads has its own buffer to receive the reply. I left some comments there to show how to produce a "wrong sequence number" exception. That exception is expected, when using a single `Socket` to send out multiple requests. A buffer shared by all threads will allow one thread's reply being processed by another thread.
Details:
I am calling Messenger.Get using SNMP V1 and I am querying 24 SNMP objects.
Exception:
{"wrong response sequence: expected -1986527, received 14790689"}
StackTrace:
at Lextm.SharpSnmpLib.Messaging.SnmpMessageExtension.GetResponse(ISnmpMessage request, Int32 timeout, IPEndPoint receiver, UserRegistry registry, Socket udpSocket) in c:\sharpsnmplib\SharpSnmpLib\Messaging\SnmpMessageExtension.cs:line 440
at Lextm.SharpSnmpLib.Messaging.SnmpMessageExtension.GetResponse(ISnmpMessage request, Int32 timeout, IPEndPoint receiver, Socket udpSocket) in c:\sharpsnmplib\SharpSnmpLib\Messaging\SnmpMessageExtension.cs:line 355
at Lextm.SharpSnmpLib.Messaging.SnmpMessageExtension.GetResponse(ISnmpMessage request, Int32 timeout, IPEndPoint receiver) in c:\sharpsnmplib\SharpSnmpLib\Messaging\SnmpMessageExtension.cs:line 320
at Lextm.SharpSnmpLib.Messaging.Messenger.Get(VersionCode version, IPEndPoint endpoint, OctetString community, IList`1 variables, Int32 timeout) in c:\sharpsnmplib\SharpSnmpLib\Messaging\Messenger.cs:line 96
at Comms.Snmp.SharpSNMPDevice.ProcessSnmpGets() in z:\Projects\SES Astra\2400 Program\Software\Source\SESAstraServer\SESAstraServer\Comms\Snmp\SharpSNMPDevice.cs:line 892
Please advise.
Comments: Can you check `TestResponsesFromSingleSourceWithMultipleThreads` in this file, https://github.com/lextm/sharpsnmplib/blob/master/Tests/Messaging/Tests/GetRequestMessageTestFixture.cs The correct way to send multiple requests to a single agent is what this test case shows, by using a dedicate `Socket` object per threads. In that way each threads has its own buffer to receive the reply. I left some comments there to show how to produce a "wrong sequence number" exception. That exception is expected, when using a single `Socket` to send out multiple requests. A buffer shared by all threads will allow one thread's reply being processed by another thread.