C# Class Brunet.Services.ConnectionHandler

Provides a wrapper around sender objects, obtaining Edges if available, otherwise overlay senders.
Inheritance: Brunet.Messaging.SimpleSource, IDataHandler
显示文件 Open project: pstjuste/brunet Class Usage Examples

Protected Properties

Property Type Description
_address_to_sender ISender>.Dictionary
_con_to_csw ConSenderWrapper>.Dictionary
_node Brunet.Symphony.StructuredNode
_ondemand Brunet.Connections.OnDemandConnectionOverlord
_ptype Brunet.Util.PType
_ptype_mb Brunet.Util.MemBlock
_sender_to_address Address>.Dictionary

Public Methods

Method Description
ConnectTo ( Address dst ) : void
ConnectionHandler ( PType ptype, StructuredNode node ) : Brunet.Connections
ContainsAddress ( Address addr ) : bool
GetAddress ( ISender sender ) : Address
GetSender ( Address addr ) : ISender
HandleData ( MemBlock data, ISender return_path, object state ) : void
Send ( Address dst, MemBlock packet ) : bool

Protected Methods

Method Description
AddConnection ( Address addr, ISender sender ) : void

Add to the dictionaries!

GetConnection ( Address addr ) : Connection
HandleConnection ( object ct, EventArgs ea ) : void

New edge...

HandleDisconnection ( object ct, EventArgs ea ) : void

Lost an edge...

RemoveConnection ( Address addr ) : void

Lost an edge, remove it from our connections

SenderToAddress ( ISender sender ) : Address
TryGetSender ( Address dst, ISender &sender ) : bool

Try to find a sender, if it exists, add to the dictionaries

ValidConnection ( Connection con ) : void
ValidDisconnection ( Connection con ) : void

Method Details

AddConnection() protected method

Add to the dictionaries!
protected AddConnection ( Address addr, ISender sender ) : void
addr Address
sender ISender
return void

ConnectTo() public method

public ConnectTo ( Address dst ) : void
dst Address
return void

ConnectionHandler() public method

public ConnectionHandler ( PType ptype, StructuredNode node ) : Brunet.Connections
ptype Brunet.Util.PType
node Brunet.Symphony.StructuredNode
return Brunet.Connections

ContainsAddress() public method

public ContainsAddress ( Address addr ) : bool
addr Address
return bool

GetAddress() public method

public GetAddress ( ISender sender ) : Address
sender ISender
return Address

GetConnection() protected method

protected GetConnection ( Address addr ) : Connection
addr Address
return Brunet.Connections.Connection

GetSender() public method

public GetSender ( Address addr ) : ISender
addr Address
return ISender

HandleConnection() protected method

New edge...
protected HandleConnection ( object ct, EventArgs ea ) : void
ct object
ea System.EventArgs
return void

HandleData() public method

public HandleData ( MemBlock data, ISender return_path, object state ) : void
data Brunet.Util.MemBlock
return_path ISender
state object
return void

HandleDisconnection() protected method

Lost an edge...
protected HandleDisconnection ( object ct, EventArgs ea ) : void
ct object
ea System.EventArgs
return void

RemoveConnection() protected method

Lost an edge, remove it from our connections
protected RemoveConnection ( Address addr ) : void
addr Address
return void

Send() public method

public Send ( Address dst, MemBlock packet ) : bool
dst Address
packet Brunet.Util.MemBlock
return bool

SenderToAddress() protected method

protected SenderToAddress ( ISender sender ) : Address
sender ISender
return Address

TryGetSender() protected method

Try to find a sender, if it exists, add to the dictionaries
protected TryGetSender ( Address dst, ISender &sender ) : bool
dst Address
sender ISender
return bool

ValidConnection() protected method

protected ValidConnection ( Connection con ) : void
con Brunet.Connections.Connection
return void

ValidDisconnection() protected method

protected ValidDisconnection ( Connection con ) : void
con Brunet.Connections.Connection
return void

Property Details

_address_to_sender protected_oe property

protected Dictionary _address_to_sender
return ISender>.Dictionary

_con_to_csw protected_oe property

protected Dictionary _con_to_csw
return ConSenderWrapper>.Dictionary

_node protected_oe property

protected StructuredNode,Brunet.Symphony _node
return Brunet.Symphony.StructuredNode

_ondemand protected_oe property

protected OnDemandConnectionOverlord,Brunet.Connections _ondemand
return Brunet.Connections.OnDemandConnectionOverlord

_ptype protected_oe property

protected PType,Brunet.Util _ptype
return Brunet.Util.PType

_ptype_mb protected_oe property

protected MemBlock,Brunet.Util _ptype_mb
return Brunet.Util.MemBlock

_sender_to_address protected_oe property

protected Dictionary _sender_to_address
return Address>.Dictionary