C# 클래스 Brunet.Tunnel.TunnelEdgeListener

Tunnels provide the ability for disconnected peers to form via existing overlay connections. For example, two nodes behind asymmetric NATs can form a tunnel over a common peer forming a virtual direct link between each other. Tunnels provide a mechanism for forming a complete ring.
상속: EdgeListener, IEdgeSendHandler, IDataHandler, IRpcHandler
파일 보기 프로젝트 열기: johnynek/brunet 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
_connections ConnectionList
_iasf IForwarderSelectorFactory
_ito ITunnelOverlap
_local_tas IList
_node Brunet.Node
_oco OverlapConnectionOverlord
_oco_trim_timeout int
_oco_trim_timer FuzzyEvent
_running int
_started int

Private Properties

프로퍼티 타입 설명

공개 메소드들

메소드 설명
CreateEdgeTo ( TransportAddress ta, EdgeCreationCallback ecb ) : void

Does not immediately create an edge to a remote node, instead, it tells a timer to wait 5 seconds prior to attempting an edge.

GetNearest ( Brunet.Address addr, ConnectionList cons ) : List

Returns our nearest neighbors to the specified address, which is in turn used to help communicate with tunnel peer.

HandleData ( MemBlock data, ISender return_path, object state ) : void

Where data packets prepended with a tunnel come. Here we receive data as well as create new TunnelEdges.

HandleEdgeSend ( Edge from, ICopyable data ) : void

Used to send data over the tunnel via forwarding senders using a randomly selected peer from our overlap list.

HandleRpc ( ISender caller, string method, IList args, object rs ) : void
Start ( ) : void
Stop ( ) : void
TunnelEdgeListener ( Node node ) : Brunet
TunnelEdgeListener ( Node node, ITunnelOverlap ito ) : Brunet
TunnelEdgeListener ( Node node, ITunnelOverlap ito, IForwarderSelectorFactory iasf ) : Brunet

보호된 메소드들

메소드 설명
AttemptToCreateOverlap ( TunnelEdgeCallbackAction teca ) : void

First we try to find a third party we can connect with for overlap, if that is successful, we attempt to connect to him, if that is successful, we create a new tunnel edge.

CloseHandler ( object o, EventArgs ea ) : void

When a TunnelEdge closes, we must remove it from our hashtable.

ConnectionHandler ( object o, EventArgs ea ) : void

We need to keep track of a current ConnectionList, so we listen to incoming connections. We also use this opportunity to rebuild our LocalTA.

CreateEdge ( TunnelEdgeCallbackAction teca, List overlap ) : void

Common code to Create an outgoing edge.

CreateEdgeTo ( TunnelEdgeCallbackAction teca ) : void

The delayed callback for CreateEdgeTo, we create an edge if there is a potential non-tunnel overlap and allow the Linker to do the rest.

DisconnectionHandler ( object o, EventArgs ea ) : void

When a disconnection occurs, we must make sure that none of our tunnels use that faulty edge / connection any more.

FailedEdgeCreate ( TunnelEdgeCallbackAction teca ) : void

Common code to signify the failure of edge creation.

OcoTrim ( System.DateTime now ) : void

A callback to trim Overlapped Connections. We do this here, since we control Oco and he is essentially headless.

UpdateNeighborIntersection ( TunnelEdge from, IDictionary msg ) : void

Whenever the node receives a new StatusMessage from a tunnel, we use this to build a consisting of the intersection of our peers creating a table of potential tunneling options. We close the edge if it is empty.

메소드 상세

AttemptToCreateOverlap() 보호된 메소드

First we try to find a third party we can connect with for overlap, if that is successful, we attempt to connect to him, if that is successful, we create a new tunnel edge.
protected AttemptToCreateOverlap ( TunnelEdgeCallbackAction teca ) : void
teca TunnelEdgeCallbackAction
리턴 void

CloseHandler() 보호된 메소드

When a TunnelEdge closes, we must remove it from our hashtable.
protected CloseHandler ( object o, EventArgs ea ) : void
o object
ea System.EventArgs
리턴 void

ConnectionHandler() 보호된 메소드

We need to keep track of a current ConnectionList, so we listen to incoming connections. We also use this opportunity to rebuild our LocalTA.
protected ConnectionHandler ( object o, EventArgs ea ) : void
o object
ea System.EventArgs
리턴 void

CreateEdge() 보호된 메소드

Common code to Create an outgoing edge.
protected CreateEdge ( TunnelEdgeCallbackAction teca, List overlap ) : void
teca TunnelEdgeCallbackAction
overlap List
리턴 void

CreateEdgeTo() 공개 메소드

Does not immediately create an edge to a remote node, instead, it tells a timer to wait 5 seconds prior to attempting an edge.
public CreateEdgeTo ( TransportAddress ta, EdgeCreationCallback ecb ) : void
ta TransportAddress
ecb EdgeCreationCallback
리턴 void

CreateEdgeTo() 보호된 메소드

The delayed callback for CreateEdgeTo, we create an edge if there is a potential non-tunnel overlap and allow the Linker to do the rest.
protected CreateEdgeTo ( TunnelEdgeCallbackAction teca ) : void
teca TunnelEdgeCallbackAction
리턴 void

DisconnectionHandler() 보호된 메소드

When a disconnection occurs, we must make sure that none of our tunnels use that faulty edge / connection any more.
protected DisconnectionHandler ( object o, EventArgs ea ) : void
o object
ea System.EventArgs
리턴 void

FailedEdgeCreate() 보호된 메소드

Common code to signify the failure of edge creation.
protected FailedEdgeCreate ( TunnelEdgeCallbackAction teca ) : void
teca TunnelEdgeCallbackAction
리턴 void

GetNearest() 공개 정적인 메소드

Returns our nearest neighbors to the specified address, which is in turn used to help communicate with tunnel peer.
public static GetNearest ( Brunet.Address addr, ConnectionList cons ) : List
addr Brunet.Address
cons ConnectionList
리턴 List

HandleData() 공개 메소드

Where data packets prepended with a tunnel come. Here we receive data as well as create new TunnelEdges.
public HandleData ( MemBlock data, ISender return_path, object state ) : void
data MemBlock
return_path ISender
state object
리턴 void

HandleEdgeSend() 공개 메소드

Used to send data over the tunnel via forwarding senders using a randomly selected peer from our overlap list.
public HandleEdgeSend ( Edge from, ICopyable data ) : void
from Edge
data ICopyable
리턴 void

HandleRpc() 공개 메소드

public HandleRpc ( ISender caller, string method, IList args, object rs ) : void
caller ISender
method string
args IList
rs object
리턴 void

OcoTrim() 보호된 메소드

A callback to trim Overlapped Connections. We do this here, since we control Oco and he is essentially headless.
protected OcoTrim ( System.DateTime now ) : void
now System.DateTime
리턴 void

Start() 공개 메소드

public Start ( ) : void
리턴 void

Stop() 공개 메소드

public Stop ( ) : void
리턴 void

TunnelEdgeListener() 공개 메소드

public TunnelEdgeListener ( Node node ) : Brunet
node Brunet.Node
리턴 Brunet

TunnelEdgeListener() 공개 메소드

public TunnelEdgeListener ( Node node, ITunnelOverlap ito ) : Brunet
node Brunet.Node
ito ITunnelOverlap
리턴 Brunet

TunnelEdgeListener() 공개 메소드

public TunnelEdgeListener ( Node node, ITunnelOverlap ito, IForwarderSelectorFactory iasf ) : Brunet
node Brunet.Node
ito ITunnelOverlap
iasf IForwarderSelectorFactory
리턴 Brunet

UpdateNeighborIntersection() 보호된 메소드

Whenever the node receives a new StatusMessage from a tunnel, we use this to build a consisting of the intersection of our peers creating a table of potential tunneling options. We close the edge if it is empty.
protected UpdateNeighborIntersection ( TunnelEdge from, IDictionary msg ) : void
from TunnelEdge
msg IDictionary
리턴 void

프로퍼티 상세

_connections 보호되어 있는 프로퍼티

protected ConnectionList _connections
리턴 ConnectionList

_iasf 보호되어 있는 프로퍼티

protected IForwarderSelectorFactory _iasf
리턴 IForwarderSelectorFactory

_ito 보호되어 있는 프로퍼티

protected ITunnelOverlap _ito
리턴 ITunnelOverlap

_local_tas 보호되어 있는 프로퍼티

protected IList _local_tas
리턴 IList

_node 보호되어 있는 프로퍼티

protected Node,Brunet _node
리턴 Brunet.Node

_oco 보호되어 있는 프로퍼티

protected OverlapConnectionOverlord,Brunet.Tunnel _oco
리턴 OverlapConnectionOverlord

_oco_trim_timeout 보호되어 있는 프로퍼티

protected int _oco_trim_timeout
리턴 int

_oco_trim_timer 보호되어 있는 프로퍼티

protected FuzzyEvent _oco_trim_timer
리턴 FuzzyEvent

_running 보호되어 있는 프로퍼티

protected int _running
리턴 int

_started 보호되어 있는 프로퍼티

protected int _started
리턴 int