C# Class Examples.ControlClientUsingFiltersAndProperties.BroadcastHandler

Inheritance: IMessageHandler
显示文件 Open project: pushtechnology/diffusion-examples

Public Methods

Method Description
BroadcastHandler ( IMessagingControl messagingControl, ISendToFilterCallback callback ) : System.Linq

Constructor.

OnActive ( string topicPath, IRegisteredHandler registeredHandler ) : void

Called when the handler has been successfully registered with the server. A session can register a single handler of each type for a given branch of the topic tree. If there is already a handler registered for the topic path the operation will fail, registeredHandler will be closed, and the session error handler will be notified. To change the handler, first close the previous handler.

OnClose ( string topicPath ) : void

Called if the handler is closed. This happens if the call to register the handler fails, or the handler is unregistered.

OnMessage ( SessionId sessionId, string topicPath, IContent content, IReceiveContext context ) : void

Receives content sent from a session via a topic.

Method Details

BroadcastHandler() public method

Constructor.
public BroadcastHandler ( IMessagingControl messagingControl, ISendToFilterCallback callback ) : System.Linq
messagingControl IMessagingControl The messaging control object.
callback ISendToFilterCallback The filter callback.
return System.Linq

OnActive() public method

Called when the handler has been successfully registered with the server. A session can register a single handler of each type for a given branch of the topic tree. If there is already a handler registered for the topic path the operation will fail, registeredHandler will be closed, and the session error handler will be notified. To change the handler, first close the previous handler.
public OnActive ( string topicPath, IRegisteredHandler registeredHandler ) : void
topicPath string The path that the handler is active for.
registeredHandler IRegisteredHandler Allows the handler to be closed.
return void

OnClose() public method

Called if the handler is closed. This happens if the call to register the handler fails, or the handler is unregistered.
public OnClose ( string topicPath ) : void
topicPath string The branch of the topic tree for which the handler was registered.
return void

OnMessage() public method

Receives content sent from a session via a topic.
public OnMessage ( SessionId sessionId, string topicPath, IContent content, IReceiveContext context ) : void
sessionId SessionId Identifies the client session that sent the content.
topicPath string The path of the topic that the content was sent on.
content IContent The content sent by the client.
context IReceiveContext The context associated with the content.
return void