C# Class Microsoft.Protocols.TestSuites.BranchCache.BranchCacheFrameworkAdapter

The content caching and retrieval framework adapter.
Inheritance: Microsoft.Protocols.TestTools.ManagedAdapterBase, IBranchCacheFrameworkAdapter
Show file Open project: Microsoft/WindowsProtocolTestSuites

Public Methods

Method Description
GetContentInfo ( string serverAddress, int port, string uri ) : Content_Information_Data_Structure

Get the content Info from the content server.

GetSegmentIds ( string serverAddress, int port, string path ) : string[]

Get the segment IDs computed using content information that is got from the content server.

GetSegmentIdsByteArray ( string serverAddress, int port, string uri ) : ICollection

Get the byte array list of segment IDs computed using content information that is got from the content server.

Initialize ( ITestSite testSite ) : void

Initialize the frame work adapter

OfferHostedCacheContentInfo ( Content_Information_Data_Structure contentInfo ) : void

Offer the block hashes to the hosted cache server.

Reset ( ) : void

Reset the adapter

SendProbeMatchMessage ( string relatesTo, string instanceId, uint messageNumber, ServiceProperty matches, string ip, int port ) : void

Send the ProbeMatch message.

StartPccrdServerListening ( ) : void

Start the MS-PCCRD server listening to incoming MS-PCCRD request message.

StartPccrrServerListening ( int port ) : void

Start the MS-PCCRR server listening to incoming MS-PCCRR request message.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Dispose(bool disposing) executes in two distinct scenarios. If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed.

Private Methods

Method Description
GetPccrtpResponse ( string serverAddress, int port, string uri ) : bool

Get the pccrtp response with http header "peerdist".

RetrievalTransport_Receive ( IPEndPoint remoteAddr, PccrrPacket pccrrPacket ) : void

The handle of MessageArrivedEventArgs happened.

Server_ReceiveProbeMessage ( IPEndPoint sender, SoapEnvelope message ) : void

Receive probe message.

ToHexString ( byte data ) : string

Convert input byte array to Hex string.

Method Details

Dispose() protected method

Dispose(bool disposing) executes in two distinct scenarios. If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed.
protected Dispose ( bool disposing ) : void
disposing bool /// If disposing equals false, the method has been called by the /// runtime from inside the finalizer and you should not reference /// other objects. Only unmanaged resources can be disposed. ///
return void

GetContentInfo() public method

Get the content Info from the content server.
public GetContentInfo ( string serverAddress, int port, string uri ) : Content_Information_Data_Structure
serverAddress string The content server address.
port int The port that the content server is listening.
uri string The path of the file to request.
return Microsoft.Protocols.TestTools.StackSdk.BranchCache.Pccrc.Content_Information_Data_Structure

GetSegmentIds() public method

Get the segment IDs computed using content information that is got from the content server.
public GetSegmentIds ( string serverAddress, int port, string path ) : string[]
serverAddress string The content server address.
port int The port that the content server is listening.
path string The path of the file to request.
return string[]

GetSegmentIdsByteArray() public method

Get the byte array list of segment IDs computed using content information that is got from the content server.
public GetSegmentIdsByteArray ( string serverAddress, int port, string uri ) : ICollection
serverAddress string The content server address.
port int The port that the content server is listening.
uri string The path of the file to request.
return ICollection

Initialize() public method

Initialize the frame work adapter
public Initialize ( ITestSite testSite ) : void
testSite ITestSite The test site instance associated with the current adapter.
return void

OfferHostedCacheContentInfo() public method

Offer the block hashes to the hosted cache server.
public OfferHostedCacheContentInfo ( Content_Information_Data_Structure contentInfo ) : void
contentInfo Microsoft.Protocols.TestTools.StackSdk.BranchCache.Pccrc.Content_Information_Data_Structure The content information
return void

Reset() public method

Reset the adapter
public Reset ( ) : void
return void

SendProbeMatchMessage() public method

Send the ProbeMatch message.
public SendProbeMatchMessage ( string relatesTo, string instanceId, uint messageNumber, ServiceProperty matches, string ip, int port ) : void
relatesTo string The relatesTo.
instanceId string The instanceId.
messageNumber uint The messageNumber.
matches ServiceProperty The matches.
ip string The ip address of content client.
port int The port of content client.
return void

StartPccrdServerListening() public method

Start the MS-PCCRD server listening to incoming MS-PCCRD request message.
public StartPccrdServerListening ( ) : void
return void

StartPccrrServerListening() public method

Start the MS-PCCRR server listening to incoming MS-PCCRR request message.
public StartPccrrServerListening ( int port ) : void
port int The listening port.
return void