C# Class Examples.ClientSendingMessages

This is a simple example of a client that uses the 'Messaging' feature to send messages on a topic path. To send messages on a topic path, the client session requires the TopicPermission.SEND_TO_MESSAGE_HANDLER permission.
显示文件 Open project: pushtechnology/diffusion-examples

Public Methods

Method Description
ClientSendingMessages ( ) : System.Collections.Generic

Constructs a message sending application.

Close ( ) : void

Close the session.

Send ( string topicPath, string message, ISendCallback callback ) : void

Sends a simple string message to a specified topic path. There will be no context with the message so callback will be directed to the 'no context' callback.

Send ( string topicPath, string message, string context, ISendContextCallback callback ) : void

Sends a simple string message to a specified topic path with context string. The callback will be directed to the contextual callback with the string provided.

SendWithHeaders ( string topicPath, string message, List headers, ISendCallback callback ) : void

Sends a string message to a specified topic with headers. There will be no context with the message so callback will be directed to the 'no context' callback.

Method Details

ClientSendingMessages() public method

Constructs a message sending application.
public ClientSendingMessages ( ) : System.Collections.Generic
return System.Collections.Generic

Close() public method

Close the session.
public Close ( ) : void
return void

Send() public method

Sends a simple string message to a specified topic path. There will be no context with the message so callback will be directed to the 'no context' callback.
public Send ( string topicPath, string message, ISendCallback callback ) : void
topicPath string The topic path.
message string The message to send.
callback ISendCallback Notifies that the message was sent.
return void

Send() public method

Sends a simple string message to a specified topic path with context string. The callback will be directed to the contextual callback with the string provided.
public Send ( string topicPath, string message, string context, ISendContextCallback callback ) : void
topicPath string
message string
context string
callback ISendContextCallback
return void

SendWithHeaders() public method

Sends a string message to a specified topic with headers. There will be no context with the message so callback will be directed to the 'no context' callback.
public SendWithHeaders ( string topicPath, string message, List headers, ISendCallback callback ) : void
topicPath string The topic path.
message string The message to send.
headers List The headers to send with the message.
callback ISendCallback Notifies that the message was sent.
return void