C# Class Microsoft.Protocols.TestTools.StackSdk.BranchCache.Pccrtp.PccrtpServer

The test server.
Inheritance: IDisposable
Show file Open project: Microsoft/WindowsProtocolTestSuites Class Usage Examples

Public Methods

Method Description
Dispose ( ) : void

Release the managed and unmanaged resources.

GenerateResponseMessage ( string resourceLocator, string serverSecret ) : PccrtpResponse

Generate PCCRTP response message to reply the client request.

PccrtpServer ( int listenPort, IPAddressType addressType ) : System

Initializes a new instance of the PccrtpServer class with specified logger instance.

PccrtpServer ( int listenPort, IPAddressType addressType, ILogPrinter logger ) : System

Initializes a new instance of the PccrtpServer class with specified logger instance.

ReceivePccrtpRequest ( System.TimeSpan timeOut ) : PccrtpRequest

The method is used to receive the PCCRTP request.

SentPccrtpResponse ( PccrtpResponse response ) : void

The method is used to send PCCRTP response message.

StartServer ( ) : void

The method is used to start PCCRTP server and start to listen request input.

StopServer ( ) : void

The method is used to stop the PCCRTP server and start to listen request input.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Release resources.

Private Methods

Method Description
OnHttpRequestMessageReceived ( object sender, HttpRequestEventArg e ) : void

The handle to HTTP request message.

Method Details

Dispose() public method

Release the managed and unmanaged resources.
public Dispose ( ) : void
return void

Dispose() protected method

Release resources.
protected Dispose ( bool disposing ) : void
disposing bool /// If disposing equals true, managed and unmanaged resources are disposed. /// If false, only unmanaged resources can be disposed. ///
return void

GenerateResponseMessage() public method

Generate PCCRTP response message to reply the client request.
public GenerateResponseMessage ( string resourceLocator, string serverSecret ) : PccrtpResponse
resourceLocator string The client request URI.
serverSecret string The server secret set on the server endpoint.
return PccrtpResponse

PccrtpServer() public method

Initializes a new instance of the PccrtpServer class with specified logger instance.
public PccrtpServer ( int listenPort, IPAddressType addressType ) : System
listenPort int Indicates the PCCRTP server's listen port.
addressType IPAddressType Indicates the PCCRTP server's address type is Ipv4 or Ipv6.
return System

PccrtpServer() public method

Initializes a new instance of the PccrtpServer class with specified logger instance.
public PccrtpServer ( int listenPort, IPAddressType addressType, ILogPrinter logger ) : System
listenPort int Indicates the PCCRTP server's listen port.
addressType IPAddressType Indicates the PCCRTP server's address type is Ipv4 or Ipv6.
logger ILogPrinter An instance of ILogPrinter.
return System

ReceivePccrtpRequest() public method

The method is used to receive the PCCRTP request.
public ReceivePccrtpRequest ( System.TimeSpan timeOut ) : PccrtpRequest
timeOut System.TimeSpan The timeout to wait the response.
return PccrtpRequest

SentPccrtpResponse() public method

The method is used to send PCCRTP response message.
public SentPccrtpResponse ( PccrtpResponse response ) : void
response PccrtpResponse The PCCRTP response message.
return void

StartServer() public method

The method is used to start PCCRTP server and start to listen request input.
public StartServer ( ) : void
return void

StopServer() public method

The method is used to stop the PCCRTP server and start to listen request input.
public StopServer ( ) : void
return void