Hi
I have an application which will be running Get requests on dozens of SNMP devices. Some will be inaccessible at times, and I'd expect different network delays to different devices.
If I use the synchronous GetResponse method, this blocks until timeout if a device is inaccessible. If I have 50 devices and a 2s timeout, and want to poll all 50 devices every 5 seconds, if three are inaccessible I wouldn't get round all 50 within the 5s cycle.
I was therefore looking at SnmpMessageExtension.BeginGetResponse, but although this is asynchronous, it still calls BeginReceive on the socket each time and also EndGetResponse throws an exception if the request id doesn't match the response id - so it's still coupling requests and responses.
What I want to be able to do is to fire off 50 Get requests at once, then process the responses as they come in - and I'd do the matching between requests and responses. Inaccessible devices wouldn't return a response, which I'd then handle.
I can't see that this is possible. The SendAsync method throws an exception if anything except a trap is sent. Am I missing something that makes it not possible to work like this?
Thanks
Giles.
Comments: Thanks for sharing your comments. Should be quite useful for others.
I have an application which will be running Get requests on dozens of SNMP devices. Some will be inaccessible at times, and I'd expect different network delays to different devices.
If I use the synchronous GetResponse method, this blocks until timeout if a device is inaccessible. If I have 50 devices and a 2s timeout, and want to poll all 50 devices every 5 seconds, if three are inaccessible I wouldn't get round all 50 within the 5s cycle.
I was therefore looking at SnmpMessageExtension.BeginGetResponse, but although this is asynchronous, it still calls BeginReceive on the socket each time and also EndGetResponse throws an exception if the request id doesn't match the response id - so it's still coupling requests and responses.
What I want to be able to do is to fire off 50 Get requests at once, then process the responses as they come in - and I'd do the matching between requests and responses. Inaccessible devices wouldn't return a response, which I'd then handle.
I can't see that this is possible. The SendAsync method throws an exception if anything except a trap is sent. Am I missing something that makes it not possible to work like this?
Thanks
Giles.
Comments: Thanks for sharing your comments. Should be quite useful for others.