C# Class Brunet.Applications.Tests.NetworkTest

Tests networking conditions across the overlay.
Show file Open project: pstjuste/brunet

Protected Properties

Property Type Description
_current_iter int
_db_con string
_fe FuzzyEvent
_node Brunet.Symphony.StructuredNode
_outstanding bool>.Dictionary
_results ResultState>.Dictionary
_running int
_sync object

Public Methods

Method Description
GetAddress ( Address addr ) : string

Returns the unique part of an address

NetworkTest ( StructuredNode node ) : Brunet.Concurrent
Stop ( ) : void

Stops the running of the job, node disconnection also calls it.

Protected Methods

Method Description
Finished ( ) : void

The test is finished, write the results to the DB

InitializeDatabase ( ) : int

Creates the database if necessary and returns the current iteration.

Invoke ( Address addr ) : void

Starts a test on the specified node.

ProcessResults ( Address addr, RpcResult result ) : void

Process a new results and determine whether or not to execute more tests on this node and the neighbors it returned.

Run ( System.DateTime now ) : void

Begin a test if there isn't already one running

Stop ( System.Data.Node n, System.Data.Node cs ) : void

Called when the Node changes state, stops the Test if necessary.

Method Details

Finished() protected method

The test is finished, write the results to the DB
protected Finished ( ) : void
return void

GetAddress() public static method

Returns the unique part of an address
public static GetAddress ( Address addr ) : string
addr Address
return string

InitializeDatabase() protected method

Creates the database if necessary and returns the current iteration.
protected InitializeDatabase ( ) : int
return int

Invoke() protected method

Starts a test on the specified node.
protected Invoke ( Address addr ) : void
addr Address
return void

NetworkTest() public method

public NetworkTest ( StructuredNode node ) : Brunet.Concurrent
node Brunet.Symphony.StructuredNode
return Brunet.Concurrent

ProcessResults() protected method

Process a new results and determine whether or not to execute more tests on this node and the neighbors it returned.
protected ProcessResults ( Address addr, RpcResult result ) : void
addr Address
result Brunet.Messaging.RpcResult
return void

Run() protected method

Begin a test if there isn't already one running
protected Run ( System.DateTime now ) : void
now System.DateTime
return void

Stop() public method

Stops the running of the job, node disconnection also calls it.
public Stop ( ) : void
return void

Stop() protected method

Called when the Node changes state, stops the Test if necessary.
protected Stop ( System.Data.Node n, System.Data.Node cs ) : void
n System.Data.Node
cs System.Data.Node
return void

Property Details

_current_iter protected property

The current iteration of the test
protected int _current_iter
return int

_db_con protected property

The string used to connedct to the DB
protected string _db_con
return string

_fe protected property

Timer to instigate running of the test
protected FuzzyEvent _fe
return FuzzyEvent

_node protected property

The Node the test is being performed for
protected StructuredNode,Brunet.Symphony _node
return Brunet.Symphony.StructuredNode

_outstanding protected property

The outstanding ResultStates
protected Dictionary _outstanding
return bool>.Dictionary

_results protected property

Maps a Node to a ResultState
protected Dictionary _results
return ResultState>.Dictionary

_running protected property

The tests is currently active
protected int _running
return int

_sync protected property

Thread-safety for the _outstanding and _results
protected object _sync
return object