SnmpSetRetry function (winsnmp.h)
[SNMP is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions. Instead, use Windows Remote Management, which is the Microsoft implementation of WS-Man.]
The WinSNMP SnmpSetRetry function enables a WinSNMP application to change the retry count value for the retransmission of SNMP message requests. The retry count applies to calls that a WinSNMP application makes to the SnmpSendMsg function for a specified management entity. The Microsoft WinSNMP implementation stores the value in a database.
Syntax
SNMPAPI_STATUS SNMPAPI_CALL SnmpSetRetry(
[in] HSNMP_ENTITY hEntity,
[in] smiUINT32 nPolicyRetry
);
Parameters
[in] hEntity
Handle to the destination management entity of interest.
[in] nPolicyRetry
Specifies a new value for the retry count for the management entity. This value replaces the value currently stored in the implementation's database.
If this parameter is equal to zero, and the current retransmission mode is equal to SNMPAPI_ON, the implementation selects a value for the retry count. The implementation uses this value when it executes the WinSNMP application's retransmission policy.
Return value
If the function succeeds, the return value is SNMPAPI_SUCCESS.
If the function fails, the return value is SNMPAPI_FAILURE. To get extended error information, call SnmpGetLastError specifying a NULL value in its session parameter. The SnmpGetLastError function can return one of the following errors.
Return code | Description |
---|---|
|
The SnmpStartup function did not complete successfully. |
|
An error occurred during memory allocation. |
|
The hEntity parameter is invalid. |
|
An unknown or undefined error occurred. |
Remarks
Typically a WinSNMP manager application, rather than an agent application, calls the SnmpSetRetry function.
For additional information, see About Retransmission and Managing the Retransmission Policy.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 2000 Professional [desktop apps only] |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Target Platform | Windows |
Header | winsnmp.h |
Library | Wsnmp32.lib |
DLL | Wsnmp32.dll |