Platform SDK: Network Management

SnmpSetTimeout

The WinSNMP SnmpSetTimeout function enables a WinSNMP application to change the time-out value for the transmission of SNMP message requests. The time-out value 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.

SNMPAPI_STATUS SnmpSetTimeout(
  HSNMP_ENTITY hEntity,        // destination management entity 
  smiTIMETICKS nPolicyTimeout  // new time-out value for database 
);

Parameters

hEntity
[in] Handle to the destination management entity of interest.
nPolicyTimeout
[in] Specifies a new time-out value, in hundredths of a second, 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 time-out value. The implementation uses this time-out value when it executes the WinSNMP application's retransmission policy.

Return Values

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.

Error Code Description
SNMPAPI_NOT_INITIALIZED The SnmpStartup function did not complete successfully.
SNMPAPI_ALLOC_ERROR An error occurred during memory allocation.
SNMPAPI_ENTITY_INVALID The hEntity parameter is invalid.
SNMPAPI_OTHER_ERROR An unknown or undefined error occurred.

Remarks

Typically a WinSNMP manager application, rather than an agent application, calls the SnmpSetTimeout function.

For additional information, see About Retransmission and Managing the Retransmission Policy.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Unsupported.
  Header: Declared in Winsnmp.h.
  Library: Use Wsnmp32.lib.

See Also

WinSNMP API Overview, WinSNMP Functions, SnmpGetTimeout, SnmpSetRetransmitMode, SnmpGetRetransmitMode