C# Класс NetMQ.Zyre.Zyre

zyre - API wrapping one Zyre node
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
Dispose ( ) : void

Release any contained resources.

Dump ( ) : void

Tell the ZyreNode to do its Dump() routine to the _defaultLogger (if there is one).

EndPoint ( ) : string

Return our node endpoint, after successful initialization.

Join ( string groupName ) : void

Join a named group; after joining a group you can send messages to the group and all Zyre nodes in that group will receive them.

Leave ( string groupName ) : void

Leave a group.

Name ( ) : string

Return our node name, after successful initialization. By default is taken from the UUID and shortened.

OwnGroups ( ) : List

Return list of currently joined groups.

PeerAddress ( System.Guid peer ) : string

Return the endpoint of a connected peer.

PeerGroups ( ) : List

Return list of groups known through connected peers. The list includes every peer group ever seen by this instance. The list can grow but it can never shrink.

PeerHeaderValue ( System.Guid peer, string key ) : string

Return the value of a header of a connected peer. Returns String.Empty if peer or key doesn't exist.

Peers ( ) : List

Return list of current peers (their Uuids).

Receive ( ) : NetMQMessage

Receive next message from network; the message may be a control. message (ENTER, EXIT, JOIN, LEAVE, STOP, EVASIVE) or data (WHISPER, SHOUT).

SetHeader ( string key, string format ) : void

Set node header; these are provided to other nodes during discovery and come in each ENTER message.

SetInterface ( string value ) : void

Set network interface for UDP beacons. If you do not set this, NetMQ will choose an interface for you. On boxes with several interfaces you should specify which one you want to use, or strange things can happen. This will only apply to the next START command.

SetInterval ( System.TimeSpan interval ) : void

Set UDP beacon discovery interval. Default is instant beacon exploration followed by pinging every 1,000 milliseconds.

SetName ( string name ) : void

Set Name (the public name of this node)

SetPort ( int port ) : void

Set UDP beacon discovery port; defaults to 5670, this call overrides that so you can create independent clusters on the same network, for e.g. development vs. production. Has no effect after Zyre.Start().

Shout ( string groupName, NetMQMessage message ) : void

Send message to a named group.

Shouts ( string groupName, string format ) : void

Start ( ) : void

Start node, after setting header values. When you start a node it begins discovery and connection.

Stop ( ) : void

Stop node; this signals to other peers that this node will go away. This is polite; however you can also just destroy the node without stopping it.

ToString ( ) : string
Uuid ( ) : System.Guid

Return our node UUID string, after successful initialization

Version ( int &major, int &minor, int &patch ) : void

Return the Zyre version for run-time API detection

Whisper ( System.Guid peer, NetMQMessage message ) : void

Send message to single peer.

Whispers ( System.Guid peer, string format ) : void

Zyre ( string name, bool useEvents = true, Action loggerDelegate = null ) : System

Create a Zyre API that communicates with a node on the ZRE bus.

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Release any contained resources.

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

Метод Описание
InboxReceiveReady ( object sender, NetMQSocketEventArgs e ) : void

This receives a message relayed by ZyreNode.ReceivePeer()

OnEnterEvent ( ZyreEventEnter enterEvent ) : void
OnEvasiveEvent ( ZyreEventEvasive evasiveEvent ) : void
OnExitEvent ( ZyreEventExit exitEvent ) : void
OnJoinEvent ( ZyreEventJoin joinEvent ) : void
OnLeaveEvent ( ZyreEventLeave leaveEvent ) : void
OnShoutEvent ( ZyreEventShout shoutEvent ) : void
OnStopEvent ( ZyreEventStop stopEvent ) : void
OnWhisperEvent ( ZyreEventWhisper whisperEvent ) : void

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

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

Release any contained resources.
public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

Release any contained resources.
protected Dispose ( bool disposing ) : void
disposing bool true if managed resources are to be released
Результат void

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

Tell the ZyreNode to do its Dump() routine to the _defaultLogger (if there is one).
public Dump ( ) : void
Результат void

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

Return our node endpoint, after successful initialization.
public EndPoint ( ) : string
Результат string

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

Join a named group; after joining a group you can send messages to the group and all Zyre nodes in that group will receive them.
public Join ( string groupName ) : void
groupName string the name of the group
Результат void

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

Leave a group.
public Leave ( string groupName ) : void
groupName string the name of the group
Результат void

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

Return our node name, after successful initialization. By default is taken from the UUID and shortened.
public Name ( ) : string
Результат string

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

Return list of currently joined groups.
public OwnGroups ( ) : List
Результат List

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

Return the endpoint of a connected peer.
public PeerAddress ( System.Guid peer ) : string
peer System.Guid The peer identity
Результат string

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

Return list of groups known through connected peers. The list includes every peer group ever seen by this instance. The list can grow but it can never shrink.
public PeerGroups ( ) : List
Результат List

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

Return the value of a header of a connected peer. Returns String.Empty if peer or key doesn't exist.
public PeerHeaderValue ( System.Guid peer, string key ) : string
peer System.Guid The Guid for the peer whose header value we want
key string The key whose header value we want
Результат string

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

Return list of current peers (their Uuids).
public Peers ( ) : List
Результат List

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

Receive next message from network; the message may be a control. message (ENTER, EXIT, JOIN, LEAVE, STOP, EVASIVE) or data (WHISPER, SHOUT).
public Receive ( ) : NetMQMessage
Результат NetMQMessage

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

Set node header; these are provided to other nodes during discovery and come in each ENTER message.
public SetHeader ( string key, string format ) : void
key string the key
format string the format string for the value
Результат void

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

Set network interface for UDP beacons. If you do not set this, NetMQ will choose an interface for you. On boxes with several interfaces you should specify which one you want to use, or strange things can happen. This will only apply to the next START command.
public SetInterface ( string value ) : void
value string the interface. A null or empty string means to use the default interface
Результат void

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

Set UDP beacon discovery interval. Default is instant beacon exploration followed by pinging every 1,000 milliseconds.
public SetInterval ( System.TimeSpan interval ) : void
interval System.TimeSpan beacon discovery interval
Результат void

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

Set Name (the public name of this node)
public SetName ( string name ) : void
name string the name to set
Результат void

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

Set UDP beacon discovery port; defaults to 5670, this call overrides that so you can create independent clusters on the same network, for e.g. development vs. production. Has no effect after Zyre.Start().
public SetPort ( int port ) : void
port int the UDP beacon discovery port override
Результат void

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

Send message to a named group.
public Shout ( string groupName, NetMQMessage message ) : void
groupName string
message NetMQMessage
Результат void

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

public Shouts ( string groupName, string format ) : void
groupName string
format string the format string for the value
Результат void

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

Start node, after setting header values. When you start a node it begins discovery and connection.
public Start ( ) : void
Результат void

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

Stop node; this signals to other peers that this node will go away. This is polite; however you can also just destroy the node without stopping it.
public Stop ( ) : void
Результат void

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

public ToString ( ) : string
Результат string

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

Return our node UUID string, after successful initialization
public Uuid ( ) : System.Guid
Результат System.Guid

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

Return the Zyre version for run-time API detection
public Version ( int &major, int &minor, int &patch ) : void
major int major version
minor int minor version
patch int patch number
Результат void

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

Send message to single peer.
public Whisper ( System.Guid peer, NetMQMessage message ) : void
peer System.Guid the peer who gets the message
message NetMQMessage the message
Результат void

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

public Whispers ( System.Guid peer, string format ) : void
peer System.Guid the peer who gets the message
format string the format string for the value
Результат void

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

Create a Zyre API that communicates with a node on the ZRE bus.
public Zyre ( string name, bool useEvents = true, Action loggerDelegate = null ) : System
name string The name of the node
useEvents bool Set this to true to disable Receive() and instead subscribe to events for getting messages from peers. Default is true.
loggerDelegate Action An action to take for logging when _verbose is true. Default is null.
Результат System