Interface ICallback
The callback interface used to return results from a call to the server.
Namespace: PushTechnology.ClientInterface.Client.Features
Assembly: Diffusion.Client.dll
Syntax
public interface ICallback
Remarks
Direct extensions of this interface support a single callback each time the callback is used in a call (the call context). If the call fails to return a result, for example if the session is closed or the operation times out, OnDiscard() will be called. Each call to the server will result in invocation of either a single callback method or OnDiscard().
In most cases where a Callback can be used it is also possible to use a IContextCallback<TContext> which may be more useful if there is a need to correlate the Callback invocation with the request that it matches. For example, if the same Callback is used for several requests, it might be useful to be able to associate the reply (or discard) with the request that was made using some context object.
If the server returns a response for an unknown call context (typically a late response for a call context has timed out), an error will be reported to the ErrorNotified handler.
Since 5.0
Methods
OnDiscard()
Called to notify that a call context was closed prematurely, typically due to a timeout or the session being closed.
Declaration
void OnDiscard()
Remarks
No further calls will be made for the context.