C# / .Net API Library Reference  4.3.2-74-ge1d4cca
Data Structures | Public Functions
SessionManager Class Reference

The SessionManager class is used to manage the flow of responses back to clients. The methods are mostly for internal use by the SDK.

Of particular interest are the methods OnSessionConnected and OnSessionDisconnected; they allow you to listen for connection and disconnection events and respond accordingly. This can prove especially useful in collaboration scenarios, to determine which users are connected at any point in time.

Public Functions

void AddResponseProvider (Guid sessionId, IResponseProvider responseProvider)
 
void CreateSession (Guid sessionId, XElement command)
 
bool DestroySession (Guid sessionId, XElement command)
 
bool DestroySession (Guid sessionId)
 
bool RemoveResponseProvider (Guid sessionId, IResponseProvider responseProvider)
 
 SessionManager ()
 

Events

Events
EventHandler< SessionEventArgsSessionConnected
 
EventHandler< SessionEventArgsSessionDisconnected
 
EventHandler< FlowControlEventArgsFlowControlChanged
 

Usage Description

void AddResponseProvider ( Guid  sessionId,
IResponseProvider  responseProvider 
)
inline

Adds a response provider for a session.

Parameters
sessionIdThe unique identifier of the session to which will be added the provider.
responseProviderThe response provider to add.

Implements ISessionManager.

void CreateSession ( Guid  sessionId,
XElement  command 
)
inline

Creates a session.

Parameters
sessionIdThe unique identifier of the newly created session.
commandThe command that caused the session creation.
bool DestroySession ( Guid  sessionId,
XElement  command 
)
inline

Destroys the specified connected session. Will return true if the specified session was connected and destroyed, or false if there was no such session.

Parameters
sessionIdThe session id.
commandThe command that caused the session destruction.
bool DestroySession ( Guid  sessionId)
inline

Destroys the specified connected session. Returns true if the session was destroyed, or false if there was no such session.

Implements ISessionManager.

bool RemoveResponseProvider ( Guid  sessionId,
IResponseProvider  responseProvider 
)
inline

Removes a response provider for a session.

Parameters
sessionIdThe unique identifier of the session from which to remove the provider.
responseProviderThe response provider to remove.

Implements ISessionManager.

Event Documentation

EventHandler<FlowControlEventArgs> FlowControlChanged

This event is triggered when flow control changes for a session.

EventHandler<SessionEventArgs> SessionConnected

This event is triggered when a session gets connected to the service.

EventHandler<SessionEventArgs> SessionDisconnected

This event is triggered when a session gets disconnected from the service.