C# 클래스 PeerLibrary.Peer

상속: IDisposable, IPeer
파일 보기 프로젝트 열기: zencoders/sambatyon 1 사용 예제들

공개 메소드들

메소드 설명
Configure ( string udpPort = "-1", string kademliaPort = "-1" ) : void

PeerLibrary.IPeer

ConnectToStream ( ) : Stream

PeerLibrary.IPeer

Dispose ( ) : void

Method created to implement the IDisposable interface and used to close all service hosts already running.

GetAllTracks ( ) : IList

Method used to get all stored tracks

GetFlow ( string RID, int begin, long length, float>.Dictionary nodes ) : void

PeerLibrary.IPeer

GetFlow ( string RID, int begin, long length, float>.Dictionary nodes, Stream stream = null ) : void

Overload of the previous method with an extern stream passed.

Peer ( bool single = false, string btpNode = "" ) : System

Peer Constructor. It initialize configuration according to the options passed, initialize the local stream, creates the databases and resolves the IP address using Dns class.

RestartFlow ( ) : void

PeerLibrary.IPeer

RunLayers ( bool withoutInterface = false ) : void

Method used to run layers (kademlia, transport, interface). Each layer is ran in a separate thread in order to allow to register the thread hosting the service with a referrer thread id (in global threadpool) that is different from the mai thread. The method will wait each layer to have completely finished booting before passing to another layer.

SearchFor ( string queryString ) : IList

PeerLibrary.IPeer

StopFlow ( ) : void

PeerLibrary.IPeer

StoreFile ( string filename ) : bool

PeerLibrary.IPeer

비공개 메소드들

메소드 설명
calculateAddresses ( ) : void

Method used to construct all local addresses according to configuration.

runInterfaceLayer ( System.ServiceModel.ServiceHost &svcHost ) : void

Method (usually runned like a thread) that privately hosts the interface service.

runKademliaLayer ( bool single, string btpNode, System.ServiceModel.ServiceHost &svcHost ) : void

Method that runs the kademlia layer

runTransportLayer ( System.ServiceModel.ServiceHost &svcHost ) : void

Method that runs the transport layer

메소드 상세

Configure() 공개 메소드

PeerLibrary.IPeer
public Configure ( string udpPort = "-1", string kademliaPort = "-1" ) : void
udpPort string String containing the value of the udpPort
kademliaPort string String containig the value of the kademliaPort
리턴 void

ConnectToStream() 공개 메소드

PeerLibrary.IPeer
public ConnectToStream ( ) : Stream
리턴 Stream

Dispose() 공개 메소드

Method created to implement the IDisposable interface and used to close all service hosts already running.
public Dispose ( ) : void
리턴 void

GetAllTracks() 공개 메소드

Method used to get all stored tracks
public GetAllTracks ( ) : IList
리턴 IList

GetFlow() 공개 메소드

PeerLibrary.IPeer
public GetFlow ( string RID, int begin, long length, float>.Dictionary nodes ) : void
RID string The resource identifier
begin int The begin point from the head of a file to start download
length long The total length of file
nodes float>.Dictionary Nodes with associated score that are used to download a file from the network
리턴 void

GetFlow() 공개 메소드

Overload of the previous method with an extern stream passed.
public GetFlow ( string RID, int begin, long length, float>.Dictionary nodes, Stream stream = null ) : void
RID string The resource identifier
begin int The begin point from the head of a file to start download
length long The total length of file
nodes float>.Dictionary Nodes with associated score that are used to download a file from the network
stream Stream The stream to use
리턴 void

Peer() 공개 메소드

Peer Constructor. It initialize configuration according to the options passed, initialize the local stream, creates the databases and resolves the IP address using Dns class.
public Peer ( bool single = false, string btpNode = "" ) : System
single bool Indicates if the peer have to run kademlia layer in single bootstrap
btpNode string Address of the suggested bootstrap node.
리턴 System

RestartFlow() 공개 메소드

PeerLibrary.IPeer
public RestartFlow ( ) : void
리턴 void

RunLayers() 공개 메소드

Method used to run layers (kademlia, transport, interface). Each layer is ran in a separate thread in order to allow to register the thread hosting the service with a referrer thread id (in global threadpool) that is different from the mai thread. The method will wait each layer to have completely finished booting before passing to another layer.
public RunLayers ( bool withoutInterface = false ) : void
withoutInterface bool indicates whether to start or not the peer interface layer.
리턴 void

SearchFor() 공개 메소드

PeerLibrary.IPeer
public SearchFor ( string queryString ) : IList
queryString string the querystring used to search
리턴 IList

StopFlow() 공개 메소드

PeerLibrary.IPeer
public StopFlow ( ) : void
리턴 void

StoreFile() 공개 메소드

PeerLibrary.IPeer
public StoreFile ( string filename ) : bool
filename string filename of the file to download
리턴 bool