Naanou.LookupService
Class PeerDiscovery

Tries to get local node on the network by finding existing nodes.

Field Summary
System.Collections.ArrayList bootStraps
System.Exception broadcastException
Naanou.LookupService.IDiscoveryMethod[] discoMethods
Naanou.LookupService.Discoveries discoveries
Naanou.LookupService.Node node
bool parentNodeIsInternal
bool queuedRestart
bool running
System.Exception webException
System.Threading.Thread workerThread

Constructor Summary
PeerDiscovery(Naanou.LookupService.Node node)
         Constructor.

Property Summary
System.Collections.ArrayList Bootstraps
         Gets the bootstrap nodes, if any
System.Exception BroadcastException
         Exception that occurred during broadcast discovery, if any
int Count
         Gets the number of discoveries made
Naanou.LookupService.Discoveries Discoveries
         Gets the discoveries made
bool IsRunning
         Gets whether discovery is currently active
bool RestartQueued
         Gets whether a restart has been queued
System.Exception WebException
         Exception that occurred during web discovery, if any

Method Summary
void NotifyBootstrap()
         Notifies our original bootstrap we are online and ready
void OnDiscoveredPeer(object sender, Naanou.LookupService.DiscoveryEventArgs args)
         Triggered by different discovery methods when they get stuff for us
void QueueRestart()
         Queue a restart of discovery. Abort using Naanou.LookupService.PeerDiscovery.QueueRestartAbort.
void QueueRestartAbort()
         Aborts a queued rediscovery
void Restart()
         Triggered from the timer established in Naanou.LookupService.PeerDiscovery.QueueRestart.
void Restarter()
void Start()
         Starts the discovery process. Use Naanou.LookupService.PeerDiscovery.DiscoveryComplete to be notified when discovery is complete. Spawns discovery process in a new thread ("Discovery"). Properties cannot be used until discovery is complete.
void Start(bool withholdState)
         Starts the discovery process. Use Naanou.LookupService.PeerDiscovery.DiscoveryComplete to be notified when discovery is complete. Spawns discovery process in a new thread ("Discovery"). Properties cannot be used until discovery is complete.
void StartImpl()
         Starts discovery
void Stop()
         Aborts discovery

Methods inherited from class System.Object
Equals, Finalize, GetHashCode, GetType, MemberwiseClone, ToString

Event Summary
System.EventHandler DiscoveryComplete
         Discovery has completed


Field Detail

bootStraps

private System.Collections.ArrayList bootStraps


broadcastException

private System.Exception broadcastException


discoMethods

private Naanou.LookupService.IDiscoveryMethod[] discoMethods


discoveries

private Naanou.LookupService.Discoveries discoveries


node

private Naanou.LookupService.Node node


parentNodeIsInternal

private bool parentNodeIsInternal


queuedRestart

private bool queuedRestart


running

private bool running


webException

private System.Exception webException


workerThread

private System.Threading.Thread workerThread

Constructor Detail

PeerDiscovery

public PeerDiscovery(Naanou.LookupService.Node node)

Constructor.

Parameters:
node - Parent node
Property Detail

Bootstraps

public System.Collections.ArrayList Bootstraps

Gets the bootstrap nodes, if any


BroadcastException

public System.Exception BroadcastException

Exception that occurred during broadcast discovery, if any


Count

public int Count

Gets the number of discoveries made


Discoveries

public Naanou.LookupService.Discoveries Discoveries

Gets the discoveries made


IsRunning

public bool IsRunning

Gets whether discovery is currently active


RestartQueued

public bool RestartQueued

Gets whether a restart has been queued


WebException

public System.Exception WebException

Exception that occurred during web discovery, if any

Method Detail

NotifyBootstrap

public void NotifyBootstrap()

Notifies our original bootstrap we are online and ready


OnDiscoveredPeer

private void OnDiscoveredPeer(object sender,
                              Naanou.LookupService.DiscoveryEventArgs args)

Triggered by different discovery methods when they get stuff for us

Parameters:
sender -
args -

QueueRestart

public void QueueRestart()

Queue a restart of discovery. Abort using Naanou.LookupService.PeerDiscovery.QueueRestartAbort.


QueueRestartAbort

public void QueueRestartAbort()

Aborts a queued rediscovery


Restart

private void Restart()

Triggered from the timer established in Naanou.LookupService.PeerDiscovery.QueueRestart.

Parameters:
o - Object

Restarter

private void Restarter()


Start

public void Start()

Starts the discovery process. Use Naanou.LookupService.PeerDiscovery.DiscoveryComplete to be notified when discovery is complete. Spawns discovery process in a new thread ("Discovery"). Properties cannot be used until discovery is complete.


Start

public void Start(bool withholdState)

Starts the discovery process. Use Naanou.LookupService.PeerDiscovery.DiscoveryComplete to be notified when discovery is complete. Spawns discovery process in a new thread ("Discovery"). Properties cannot be used until discovery is complete.

Parameters:
withholdState - If TRUE, node state will not be changed to Discovery

StartImpl

private void StartImpl()

Starts discovery


Stop

public void Stop()

Aborts discovery

Event Detail

DiscoveryComplete

public System.EventHandler DiscoveryComplete

Discovery has completed