Platform SDK: Network Management |
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.
SNMPAPI_STATUS SnmpSetRetransmitMode( smiUINT32 nRetransmitMode // new retransmission mode );
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. |
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_MODE_INVALID | The implementation does not support the requested retransmission mode. |
SNMPAPI_OTHER_ERROR | An unknown or undefined error occurred. |
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.
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Unsupported.
Header: Declared in Winsnmp.h.
Library: Use Wsnmp32.lib.
WinSNMP API Overview, WinSNMP Functions, SnmpSendMsg, SnmpRegister, SnmpGetRetransmitMode, SnmpGetTimeout, SnmpGetRetry, SnmpCancelMsg