CancelRequest Method
Cancels a pending request.
Syntax
ANSI (Cross Platform) int CancelRequest(const char* lpszRequestId); Unicode (Windows) INT CancelRequest(LPCWSTR lpszRequestId);
- (void)cancelRequest:(NSString*)requestId;
#define MID_COAP_CANCELREQUEST 2 IPWORKSIOT_EXTERNAL int IPWORKSIOT_CALL IPWorksIoT_CoAP_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);
Remarks
This method cancels the request in the PendingRequest* properties identified by RequestId.
When the class is operating in client mode, the requests in the PendingRequest* properties represent outgoing requests for which responses have not yet been received. Canceling one will cause the RequestComplete event to fire with an appropriate ErrorCode and ErrorDescription.
When the class is operating in server mode, the requests in the PendingRequest* properties represent incoming requests for which responses have not yet been sent. Canceling one will cause the ResponseComplete event to fire with an appropriate ErrorCode and ErrorDescription.
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.)