OpenDOF Project
DOFResult DOFOperationInvoke_WaitResult ( const DOFOperation  op,
uint32  timeout,
DOFException pException 
)

Wait for and return the result of the Invoke Operation.

If the operation already has received a result, this returns immediately with the result.

Resource Management:
This function allocates resources that must later be freed by calling DOFResult_Destroy.
Note
For broadcast or multicast operations, this returns the first result only. Multiple results are returned only via the operation's callback.

This blocks the caller until the operation has a result or exception (or completes normally), the operation times out or is cancelled, or the timeout of this wait expires, whichever occurs first.

The time specified in this call has no relationship to the Operation itself; it only specifies how long this call will block the caller.

It is not safe to use this call if the operation's complete callback can result in a call to DOFOperation_Destroy (refer to that function's documentation for more information).

Parameters
opThe Operation. This must not be NULL and must represent a valid Invoke Operation.
timeoutThe maximum time to wait for the result, in milliseconds. A value of 0 returns immediately whether or not a result is available.
[out]pExceptionAn Exception. If pException is NULL, no exception is reported. Otherwise, the output is either a DOFException, or NULL to indicate no exception occurred. DOFException_Destroy must be called to destroy the returned DOFException, if any.
Returns
The DOFResult of the Operation, or NULL if a result cannot be returned. There are two cases in which a result cannot be returned:
  • If the operation's result was an exception, the exception is reported via pException, which will be non-NULL.
  • If the operation does not have a result within the specified timeout, or completes without a result within the specified timeout, pException will represent a DOFERROR_TIMEOUT.
core-c-dof-oal Version 8.0.1 Build 0
2018-01-22