pdcomm::opcua::MfcClientEvent
Struct
One event taken from the worker's mailbox with MfcClientWorker::Drain().
struct MfcClientEventkind tells which members are meaningful; the others keep their defaults. A Failed event's phase tells where it happened:
begin: the request was rejected before sending. With #PDCOMM_OPCUA_INVALID_INPUT or #PDCOMM_OPCUA_LIMIT only that request fails; any other status also ends the worker.response: the request was sent, but client::take() completed it with #PDCOMM_OPCUA_RUNTIME_ERROR: the server aborted the response (a Part 6 abort chunk; the text names the StatusCode) or the response was invalid. Only that request fails. An invalid response also closes the connection, so the worker then ends with aworkerfailure.abort: the worker stopped before the request completed (#PDCOMM_OPCUA_CLOSED); the request may or may not have been sent.workerwith correlation 0: connect, activation, poll, take, close or the adapter failed; the worker stops.
Members
aborted
Field
Stopped: the worker ended any other way; always !orderly.
bool aborted = falseaccepted
Field
Stopped: requests admitted by Submit().
ULONGLONG accepted = 0completed
Field
Stopped: requests that ended with a response or a begin or response failure.
ULONGLONG completed = 0correlation
Field
Pending, Completed, Failed: correlation passed to MfcClientWorker::Submit(); 0 for a worker failure.
ULONGLONG correlation = 0discarded
Field
Stopped: requests that ended with an abort failure.
ULONGLONG discarded = 0kind
Field
Event kind.
MfcClientEventKind kind = MfcClientEventKind::Failedmetadata
Field
Completed: request ID, encoding ID and serviceResult of the response.
pdcomm_opcua_response_info metadata{}orderly
Field
Stopped: a drain finished with CloseSession and channel close.
bool orderly = falseownerThread
Field
Ready: Win32 thread ID of the worker thread that owns the native client.
DWORD ownerThread = 0phase
Field
Failed: begin, response, abort or worker.
CString phasereason
Field
Stopped: drained-and-closed, aborted, native-error or adapter-error.
CString reasonrequestId
Field
Pending, Completed: native request ID (the requestHandle).
uint32_t requestId = 0status
Field
Failed: ::pdcomm_opcua_status value of the failure.
int32_t status = PDCOMM_OPCUA_OKtext
Field
Failed: English detail text, copied in the worker thread right after the native call.
CString textvalue
Field
Completed: the owned response, possibly a ServiceFault. It survives the client and the worker and holds a native handle until the last reference is gone.
std::shared_ptr<const response> value