本文介绍了Snmp Mgmt Api超时和重试行为Win 2008 Server R1 x64的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我注意到在使用MS SNMP Mgmt Api时,在超时和重试方面有些奇怪的snmp通信行为.我想知道Win Server 2008 R1 x64是否支持mgmt api.这是一个使用mgmt api进行通信的C ++ 64位snmp扩展代理 以及其他代理商.这是我的伪代码: SnmpMgrOpen(IP地址,150ms超时,3次重试)开始= getTickCount()结果= SnmpMgrRequest(获取具有3个或4个OID的请求)finish = getTickCount()如果(结果==错误){ 记录错误,包括总时间(即完成-开始滴答声)}SnmpMgrClose()当snmpMgrRequest调用超时时,总时间等于1014ms至5000ms.如果将重试次数设置为0,则总时间仍然是1014毫秒到5000毫秒.我希望重试到0后,SnmpMgrRequest会在150ms内超时.该文档似乎暗示了这一点.我是否错过了至少至少一秒钟的超时时间?可能是什么原因导致了这种行为? MS是否建议使用更可靠的SNMP实现?任何帮助将不胜感激. 解决方案 I'm noticing some weird snmp communication behavior when using MS SNMP Mgmt Api in terms of timeout and retries. I was wondering if mgmt api is supported on Win Server 2008 R1 x64. This is a C++ 64bit snmp extension agent that uses the mgmt api to communicate with other agents as well.This is my pseudo code:SnmpMgrOpen(ip address, 150ms timeout, 3 retries)start = getTickCount()result = SnmpMgrRequest(get request with 3 or 4 OIDs)finish = getTickCount()if (result == some error){ log Error including total time (i.e finish - start ticks)}SnmpMgrClose()When the snmpMgrRequest call times out, the total time equals anywhere from 1014ms to 5000ms. If, I set retries to 0, the total time is still 1014ms to 5000ms.I would expect, with retries to 0 that the SnmpMgrRequest would timeout within 150ms. The documentation seems to imply this. Am I missing something is there a minimum timeout period of at least a second? What could be causing this behavior?Does MS recommend a more reliable SNMP implementation?Any help would be greatly appreciated. I'm at a lost here. 解决方案 这篇关于Snmp Mgmt Api超时和重试行为Win 2008 Server R1 x64的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-04 07:16