C# Класс NetMQ.Sockets.SubscriberSocket

A SubscriberSocket is a NetMQSocket intended to be used as the "Sub" in the PubSub pattern. The intended usage is to receive messages from the publisher socket.
Наследование: NetMQSocket
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
Subscribe ( byte topic ) : void

Subscribe this socket to the given 'topic' - which means enable this socket to receive messages that begin with this array of bytes.

Subscribe ( string topic ) : void

Subscribe this socket to the given 'topic' - which means enable this socket to receive messages that begin with this string prefix. You can set topic to an empty string to subscribe to everything.

Subscribe ( string topic, Encoding encoding ) : void

Subscribe this socket to the given 'topic' - which means enable this socket to receive messages that begin with this string prefix, using the given Encoding. You can set topic to an empty string to subscribe to everything.

SubscribeToAnyTopic ( ) : void

Subscribe this socket to all topics - which means enable this socket to receive all messages regardless of what the string prefix is. This is the same as calling Subscribe with an empty-string for the topic.

SubscriberSocket ( string connectionString = null ) : System

Create a new SubscriberSocket and attach socket to zero or more endpoints.

TrySend ( Msg &msg, System.TimeSpan timeout, bool more ) : bool
Unsubscribe ( byte topic ) : void

Remove this socket's subscription to the given topic.

Unsubscribe ( string topic ) : void

Remove this socket's subscription to the given topic.

Unsubscribe ( string topic, Encoding encoding ) : void

Remove this socket's subscription to the given topic.

Приватные методы

Метод Описание
Send ( Msg &msg, SendReceiveOptions options ) : void
SubscriberSocket ( SocketBase socketHandle ) : System

Create a new SubscriberSocket based upon the given SocketBase.

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

Subscribe() публичный метод

Subscribe this socket to the given 'topic' - which means enable this socket to receive messages that begin with this array of bytes.
public Subscribe ( byte topic ) : void
topic byte this specifies what byte-array prefix to subscribe to
Результат void

Subscribe() публичный метод

Subscribe this socket to the given 'topic' - which means enable this socket to receive messages that begin with this string prefix. You can set topic to an empty string to subscribe to everything.
public Subscribe ( string topic ) : void
topic string this specifies what text-prefix to subscribe to, or may be an empty-string to specify ALL
Результат void

Subscribe() публичный метод

Subscribe this socket to the given 'topic' - which means enable this socket to receive messages that begin with this string prefix, using the given Encoding. You can set topic to an empty string to subscribe to everything.
public Subscribe ( string topic, Encoding encoding ) : void
topic string this specifies what text-prefix to subscribe to, or may be an empty-string to specify ALL
encoding System.Text.Encoding the character-Encoding to use when converting the topic string internally into a byte-array
Результат void

SubscribeToAnyTopic() публичный метод

Subscribe this socket to all topics - which means enable this socket to receive all messages regardless of what the string prefix is. This is the same as calling Subscribe with an empty-string for the topic.
public SubscribeToAnyTopic ( ) : void
Результат void

SubscriberSocket() публичный метод

Create a new SubscriberSocket and attach socket to zero or more endpoints.
public SubscriberSocket ( string connectionString = null ) : System
connectionString string List of NetMQ endpoints, seperated by commas and prefixed by '@' (to bind the socket) or '>' (to connect the socket). /// Default action is connect (if endpoint doesn't start with '@' or '>')
Результат System

TrySend() публичный метод

public TrySend ( Msg &msg, System.TimeSpan timeout, bool more ) : bool
msg Msg
timeout System.TimeSpan
more bool
Результат bool

Unsubscribe() публичный метод

Remove this socket's subscription to the given topic.
public Unsubscribe ( byte topic ) : void
topic byte a byte-array denoting which the topic to stop receiving
Результат void

Unsubscribe() публичный метод

Remove this socket's subscription to the given topic.
public Unsubscribe ( string topic ) : void
topic string a string denoting which the topic to stop receiving
Результат void

Unsubscribe() публичный метод

Remove this socket's subscription to the given topic.
public Unsubscribe ( string topic, Encoding encoding ) : void
topic string a string denoting which the topic to stop receiving
encoding System.Text.Encoding the Encoding to use when converting the topic string internally into a byte-array
Результат void