Snmp Mgmt Api超时和重试行为Win 2008 Server R1 x64 [英] Snmp Mgmt Api timeout and retry behavior Win 2008 Server R1 x64

查看:180
本文介绍了Snmp Mgmt Api超时和重试行为Win 2008 Server R1 x64的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到在使用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实现?

任何帮助将不胜感激.

解决方案

超时粒度为1秒,因此150ms将在150ms至1秒之间超时.重试次数为0表示我们第一次看到请求超过其超时值,从而使请求超时.

 

这是多线程应用程序吗?如果是,则5秒钟的超时应该是由于我们本月在snmp中修复的错误所致:

http://support.microsoft.com/kb/2549268/en-gb

有关snmp api的实现,请参见Windows sdk中的示例snmputil文件.


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.

解决方案

The timeout granularity is 1 second, so 150ms will timeout between 150ms and 1 second. 0 retries means we timeout the request the 1st time we see that its passed its timeout value.

 

Is this a multithreaded app ? If yes, the 5 second timeout should be due to a bug we fixed in snmp this month :

http://support.microsoft.com/kb/2549268/en-gb

For implementation of snmp apis, see the sample snmputil file in the windows sdk.


这篇关于Snmp Mgmt Api超时和重试行为Win 2008 Server R1 x64的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆