SnmpSetRetransmitMode 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 SnmpSetRetransmitMode function enables a WinSNMP application to set the retransmission mode. The Microsoft WinSNMP implementation uses the new retransmission mode to govern transmission time-outs and retransmission attempts on subsequent calls to the SnmpSendMsg function.

Syntax

SNMPAPI_STATUS SNMPAPI_CALL SnmpSetRetransmitMode(
  [in] smiUINT32 nRetransmitMode
);

Parameters

[in] nRetransmitMode

Specifies a value for the new retransmission mode. This parameter must be one of the following values.

Value Meaning
SNMPAPI_ON
The implementation executes the WinSNMP application's retransmission policy.
SNMPAPI_OFF
The implementation does not execute 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
SNMPAPI_NOT_INITIALIZED
The SnmpStartup function did not complete successfully.
SNMPAPI_ALLOC_ERROR
An error occurred during memory allocation.
SNMPAPI_MODE_INVALID
The implementation does not support the requested retransmission mode.
SNMPAPI_OTHER_ERROR
An unknown or undefined error occurred.

Remarks

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

If a WinSNMP application sets the retransmission mode to SNMPAPI_OFF, the implementation does not initiate retransmission attempts for new SNMP communications operations. The new setting affects all subsequent calls to the SnmpSendMsg function, until the WinSNMP application sets the retransmission mode back to SNMPAPI_ON.

Calling the SnmpCancelMsg function is equivalent to calling the SnmpSetRetransmitMode function, for a specific SNMP message, with the retransmission mode equal to SNMPAPI_OFF.

Note  If the implementation returns the error SNMPAPI_MODE_INVALID to a call to SnmpSetRetransmitMode, the WinSNMP application must execute the retransmission policy.
 
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

See also

SnmpCancelMsg

SnmpGetRetransmitMode

SnmpGetRetry

SnmpGetTimeout

SnmpRegister

SnmpSendMsg

WinSNMP Functions

WinSNMP API Overview