The message receive delegate is invoked for each received message on this flow. The flow event delegate is invoked when flow events occur, such as the flow going up or down. Both delegates are invoked in the context of the context thread to which this session belongs.
Note: disposing the corresponding context (IContext) or any of its contained context timers (TimerTask), sessions (ISession) or flows (IFlow) must not be performed from within the registered delegates (messageEventHandler or flowEventHandler).
IFlow CreateFlow(
FlowProperties flowProperties,
IEndpoint endPoint,
ISubscription subscription,
EventHandler<MessageEventArgs> messageEventHandler,
EventHandler<FlowEventArgs> flowEventHandler,
EndpointProperties endPointProperties
)
Client applications can call GetLastSDKErrorInfo from within the flow event delegate to get more info on the type of error condition reported by FlowEventArgs.
OperationErrorException | Thrown when the operation fails. Possible sub-codes: |
ObjectDisposedException | Thrown when the session is already disposed (terminal state). |
FatalErrorException | Thrown when an unrecoverable error occurs. |
ArgumentNullException | Thrown if any of the required parameters is null. |
ArgumentException | Thrown if arguments fail validation. |