C# Class 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.
Inheritance: NetMQSocket
Afficher le fichier Open project: NetMQ/NetMQ3-x Class Usage Examples

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
Send ( Msg &msg, SendReceiveOptions options ) : void
SubscriberSocket ( SocketBase socketHandle ) : System

Create a new SubscriberSocket based upon the given SocketBase.

Method Details

Subscribe() public méthode

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
Résultat void

Subscribe() public méthode

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
Résultat void

Subscribe() public méthode

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
Résultat void

SubscribeToAnyTopic() public méthode

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
Résultat void

SubscriberSocket() public méthode

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 '>')
Résultat System

TrySend() public méthode

public TrySend ( Msg &msg, System.TimeSpan timeout, bool more ) : bool
msg Msg
timeout System.TimeSpan
more bool
Résultat bool

Unsubscribe() public méthode

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
Résultat void

Unsubscribe() public méthode

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
Résultat void

Unsubscribe() public méthode

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
Résultat void