C# Класс 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.
Показать файл Открыть проект

Открытые методы

Метод Описание
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.

Описание методов

ClientSendingMessages() публичный Метод

Constructs a message sending application.
public ClientSendingMessages ( ) : System.Collections.Generic
Результат System.Collections.Generic

Close() публичный Метод

Close the session.
public Close ( ) : void
Результат void

Send() публичный Метод

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.
Результат void

Send() публичный Метод

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
Результат void

SendWithHeaders() публичный Метод

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.
Результат void