Skip to content
Start free evaluation

pdcomm_opcua_client_take_response

Function

Takes the validated response of one request.

int32_t pdcomm_opcua_client_take_response(pdcomm_opcua_handle client, uint32_t request, pdcomm_opcua_handle *out)

Declared in: #include <pdcomm/opcua/pdcomm_opcua.h>

#PDCOMM_OPCUA_OK means the body was completely decoded, its requestHandle matches and it is either the expected response type or a ServiceFault with a Bad serviceResult. Inspect pdcomm_opcua_response_get_info() and the per-operation results in the body: a Bad operation result is still OK.

A response that fails this validation closes the client and returns #PDCOMM_OPCUA_RUNTIME_ERROR. When the server aborts the response with a Part 6 abort chunk, only that request fails: the call returns #PDCOMM_OPCUA_RUNTIME_ERROR with the abort StatusCode in the last error text, the request is complete and the connection stays usable.

If the handle registry is full, the call returns #PDCOMM_OPCUA_LIMIT and holds the response: release other buffers and call this function again for the same request before any begin, poll, activation or close, which return #PDCOMM_OPCUA_BUSY meanwhile.

Parameters

NameDescription
clientClient handle.
requestID returned by pdcomm_opcua_client_begin().
outReceives the response buffer handle; zero unless OK.

Returns

#PDCOMM_OPCUA_OK, #PDCOMM_OPCUA_EMPTY when the response has not arrived, #PDCOMM_OPCUA_INVALID_INPUT for an unknown or completed request ID, #PDCOMM_OPCUA_RUNTIME_ERROR, #PDCOMM_OPCUA_LIMIT, #PDCOMM_OPCUA_BUSY when another response is held, #PDCOMM_OPCUA_CLOSED, #PDCOMM_OPCUA_INVALID_HANDLE or #PDCOMM_OPCUA_POISONED.