Platform SDK: Network Management |
A WinSNMP application calls the SnmpCancelMsg function to request that the Microsoft WinSNMP implementation cancel retransmission attempts and time-out notifications for an SNMP request message. The SnmpCancelMsg function is an element of the WinSNMP API, version 2.0.
SNMPAPI_STATUS SnmpCancelMsg( HSNMP_SESSION session, // handle to the WinSNMP session smiINT32 reqId // request_id field of the PDU );
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. The SnmpGetLastError function can return one of the following errors.
Error code | Description |
---|---|
SNMPAPI_SESSION_INVALID | The session parameter is invalid. |
SNMPAPI_PDU_INVALID | The reqId parameter does not identify an outstanding message for the specified session. |
SNMPAPI_NOT_INITIALIZED | The SnmpStartup function did not complete successfully. |
SNMPAPI_ALLOC_ERROR | An error occurred during memory allocation. |
SNMPAPI_OTHER_ERROR | An unknown or undefined error occurred. |
Calling the SnmpCancelMsg function is equivalent to calling the SnmpSetRetransmitMode function, for a specific SNMP message, with the retransmission mode equal to SNMPAPI_OFF.
For more information, see Canceling 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, SnmpSetRetransmitMode