So there has been another update of the library posted on SourceForge.
I got some very good feedback from a nice guy named Pavel. I think I managed to work a lot of his feedback and bug reports into the version 0.7.1. Some of it was bugs that needed fixing, other things where little improvements. So thanks to Pavel and encouragement to everybody to let me know about what you like or don’t like about the library so I can work on making it better.
One fix that was needed was incorrect handling of retries in the UdpTransport class. I don’t know about you but in my way of thinking retry count should be the number of requests that is being sent in addition to the original request. In other words, if retry count = 0, then a single request with no retries is sent, retry = 1 is one request and 1 retry request, etc. Unfortunately, my retry logic was faulty and every request was sent with retry count of retry+1. That’s fixed now, thanks to anonymous for taking the time to submit a bug about extra delay on SimpleSnmp requests.
That is the second issue I have been looking into. Above mentioned anonymous posted a bug where a SimpleSnmp request would take considerably longer to return then timeout value that was set. In other words, if you set the timeout to 1000ms and retry count to 0, request method would return 3 seconds (3000ms) later. Part of the problem was in the sending of one extra retry, so if you set retry to 0 you would actually get 1 request + 1 retry accounting for 1 extra second. This still leaves one additional second that is “lost”.
After looking through the code and doing a little profiling I cannot pinpoint exactly where 500ms gets lost. On the high level, it looks like the delay is somewhere in the framework but it’s hard to say from profiler reports because delay keeps shifting. For now the delay is what it is but I’ll have to keep looking around to see where this penalty comes from and how to eliminate it.