Interface ISessionOpenContextCallback<TContext>
The callback interface for non-blocking opening of sessions.
Inherited Members
Namespace: PushTechnology.ClientInterface.Client.Session
Assembly: Diffusion.Client.dll
Syntax
public interface ISessionOpenContextCallback<in TContext> : IContextCallback<TContext>
Type Parameters
Name | Description |
---|---|
TContext | The context type. |
Remarks
This is used when a session is opened using Open<TContext>(String, TContext, ISessionOpenContextCallback<TContext>).
It is guaranteed that one and only one of the callback methods will be called.
An arbitrary
TContext
object will be attached to callback notifications.
Added in 5.3.
Examples
An example implementation for the callback with a context of type System.Int32
.
class SessionOpenCallback : ISessionOpenContextCallback<int> {
public void OnError( int context, ErrorReason errorReason ) {
// TODO: Handle session open error in here.
}
public void OnOpened( int context, ISession session ) {
// TODO: Handle opened session in here.
}
}
Methods
OnOpened(TContext, ISession)
Called when a session has been successfully opened.
Declaration
void OnOpened(TContext context, ISession session)
Parameters
Type | Name | Description |
---|---|---|
TContext | context | The context object supplied when making the call. |
ISession | session | The opened session instance. |
Remarks
Added in 5.3.