Skip to content
Start free evaluation

pdcomm::opcua::MfcClientEvent

Struct

One event taken from the worker's mailbox with MfcClientWorker::Drain().

struct MfcClientEvent

kind 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 a worker failure.
  • abort: the worker stopped before the request completed (#PDCOMM_OPCUA_CLOSED); the request may or may not have been sent.
  • worker with 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 = false

accepted

Field

Stopped: requests admitted by Submit().

ULONGLONG accepted = 0

completed

Field

Stopped: requests that ended with a response or a begin or response failure.

ULONGLONG completed = 0

correlation

Field

Pending, Completed, Failed: correlation passed to MfcClientWorker::Submit(); 0 for a worker failure.

ULONGLONG correlation = 0

discarded

Field

Stopped: requests that ended with an abort failure.

ULONGLONG discarded = 0

kind

Field

Event kind.

MfcClientEventKind kind = MfcClientEventKind::Failed

metadata

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 = false

ownerThread

Field

Ready: Win32 thread ID of the worker thread that owns the native client.

DWORD ownerThread = 0

phase

Field

Failed: begin, response, abort or worker.

CString phase

reason

Field

Stopped: drained-and-closed, aborted, native-error or adapter-error.

CString reason

requestId

Field

Pending, Completed: native request ID (the requestHandle).

uint32_t requestId = 0

status

Field

Failed: ::pdcomm_opcua_status value of the failure.

int32_t status = PDCOMM_OPCUA_OK

text

Field

Failed: English detail text, copied in the worker thread right after the native call.

CString text

value

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