C# Class NetMQ.Zyre.ZyreNode

Inheritance: IDisposable
Datei anzeigen Open project: NetMQ/Zyre Class Usage Examples

Public Methods

Method Description
Dispose ( ) : void

Release any contained resources.

ToString ( ) : string

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Release any contained resources.

Private Methods

Method Description
BeaconMessage ( int port ) : byte[]

Beacon 22-byte message per http://rfc.zeromq.org/spec:36

Create ( PairSocket outbox, Action loggerDelegate = null ) : NetMQActor

Create a new node and return the actor that controls it. All node control is done through _actor. outbox is passed to ZyreNode for sending Zyre message traffic back to caller.

Dump ( ) : void
IsValidBeacon ( byte bytes, System.Guid &uuid, int &port ) : bool

Given a ZRE beacon header, return

JoinPeerGroup ( ZyrePeer peer, string groupName ) : void

Join peer to group

LeavePeerGroup ( ZyrePeer peer, string groupName ) : void

Have peer leave group

MethodNameLevelAbove ( ) : string

Return a string showing the class name and method of method calling the method calling this method, used for reporting errors

OnBeaconReady ( object sender, NetMQBeaconEventArgs e ) : void
OnInboxReady ( object sender, NetMQSocketEventArgs e ) : void
OnPipeReceiveReady ( object sender, NetMQSocketEventArgs e ) : void
OnReapTimerElapsed ( object sender, NetMQTimerEventArgs e ) : void
PingPeer ( ZyrePeer peer ) : bool

We do this once a second: - if peer has gone quiet, send TCP ping and emit EVASIVE event - if peer has disappeared, expire it

PopGuid ( NetMQMessage message ) : System.Guid

Utility to read a Guid from a message. We transmit 16 bytes that define the Uuid.

PublishBeacon ( int port ) : void
PurgePeer ( ZyrePeer peer, string endpoint ) : void

Delete peer for a given endpoint

ReceiveApi ( ) : void

Here we handle the different control messages from the front-end

ReceiveBeacon ( ) : void

Handle beacon data

ReceivePeer ( ) : void

Here we handle messages coming from other peers

RemovePeer ( ZyrePeer peer ) : void

Remove a peer from our data structures

RemovePeerFromGroup ( ZyreGroup group, ZyrePeer peer ) : void

Remove peer from group, if it's a member

RequirePeer ( System.Guid uuid, string endpoint ) : ZyrePeer

Find or create peer via its UUID

RequirePeerGroup ( string groupName ) : ZyreGroup

Find or create group via its name

RunActor ( PairSocket shim ) : void

This method is being run asynchronously by m_actor.

Start ( string interfaceName ) : bool

Start node. Use beacon discovery. We get a new _inbox (RouterSocket listening to peers) and a new _beacon on every Start(). Also a new _port and _endpoint at each Start()

Stop ( ) : void

Stop node discovery and interconnection

ZyreNode ( PairSocket outbox, Action loggerDelegate = null ) : System

Method Details

Dispose() public method

Release any contained resources.
public Dispose ( ) : void
return void

Dispose() protected method

Release any contained resources.
protected Dispose ( bool disposing ) : void
disposing bool true if managed resources are to be released
return void

ToString() public method

public ToString ( ) : string
return string