SendResponse Method

Sends a response packet to a Get, Get-Next, Get-Bulk, or Set request.

Syntax

ANSI (Cross Platform)
int SendResponse(const char* lpszRemoteHost, int iRemotePort, int iRequestId, const char* lpszCommunity, int iErrorStatus, int iErrorIndex);

Unicode (Windows)
INT SendResponse(LPCWSTR lpszRemoteHost, INT iRemotePort, INT iRequestId, LPCWSTR lpszCommunity, INT iErrorStatus, INT iErrorIndex);
- (void)sendResponse:(NSString*)remoteHost :(int)remotePort :(int)requestId :(NSString*)community :(int)errorStatus :(int)errorIndex;
#define MID_SNMPAGENT_SENDRESPONSE 9

IPWORKSSNMP_EXTERNAL int IPWORKSSNMP_CALL IPWorksSNMP_SNMPAgent_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);

Remarks

Use this method to send asynchronous response packets. A valid RequestId must be specified. SendResponse sends an unauthenticated response packet. Depending upon the value of the SNMPVersion property, the packet is constructed as an SNMPv1, SNMPv2c, or SNMPv3 (unauthenticated) response PDU. To send authenticated or encrypted SNMPv3 responses, use SendSecureResponse

The RemoteHost and RemotePort parameters are used to determine where the response is to be sent. The object identifiers, types, and values for the request are taken from the Objects collection. The RequestId, Community, ErrorStatus, and ErrorIndex parameters are used to specify other properties of the response.

Error Handling (C++)

This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks SNMP 2020 C++ Edition - Version 20.0 [Build 8202]