C# Class Microsoft.Protocols.TestTools.StackSdk.BranchCache.Pchc.PCHCServer

The PCHC server class which is used to exchange the pchc message between the client.
Inheritance: IDisposable
Afficher le fichier Open project: Microsoft/WindowsProtocolTestSuites Class Usage Examples

Méthodes publiques

Méthode Description
CreateResponseMessage ( RESPONSE_CODE responseCode ) : RESPONSE_MESSAGE

Create pchc response message.

Dispose ( ) : void

Implement IDisposable. Do not make this method virtual. A derived class should not be able to override this method.

ExpectInitialOfferMessage ( string ipaddress, System.TimeSpan timeout ) : INITIAL_OFFER_MESSAGE

Expect the INITIAL_OFFER_MESSAGE request from the client.

ExpectSegmentInfoMessage ( string ipaddress, System.TimeSpan timeout ) : SEGMENT_INFO_MESSAGE

Expect the SEGMENT_INFO_MESSAGE request from the client.

PCHCServer ( ) : System

Initializes a new instance of the PCHCServer class with the default transport type: Https; hosted cache server listen port: 443; IPAddress type: IPv4;

PCHCServer ( ILogPrinter logger ) : System

Initializes a new instance of the PCHCServer class with specified logger instance and the default transport type: Https; hosted cache server listen port: 443; IPAddress type: IPv4;

PCHCServer ( TransferProtocol transferProtocol, int hostedCacheModeListenPort, IPAddressType ipaddressType ) : System

Initializes a new instance of the PCHCServer class with the specified osted Cache Mode Listen Port and IPAddress type.

PCHCServer ( TransferProtocol transferProtocol, int hostedCacheModeListenPort, IPAddressType ipaddressType, ILogPrinter logger ) : System

Initializes a new instance of the PCHCServer class with the specified osted Cache Mode Listen Port and IPAddress type.

SendHttpStatusCode401 ( ) : void

Send http status code 401.

SendPackage ( RESPONSE_MESSAGE responseMessage ) : void

Send Reponse Message to the client.

Start ( ) : void

Start the http server process to listen and receive and http request.

Stop ( ) : void

Stop the http server process and Release this object resources.

Private Methods

Méthode Description
DecomposeHttpRequest ( HttpListenerRequest httpListenerRequest ) : void

Get the request body byte array from the specified http request.

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. 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

ReceiveHttpRequest ( object sender, HttpRequestEventArg e ) : void

THe handle for the received http request event.

SendByte ( byte reponseMessagePayload ) : void

Send the response payload.

Method Details

CreateResponseMessage() public méthode

Create pchc response message.
public CreateResponseMessage ( RESPONSE_CODE responseCode ) : RESPONSE_MESSAGE
responseCode RESPONSE_CODE /// The response code indicates the hosted cache server response to the client request message ///
Résultat RESPONSE_MESSAGE

Dispose() public méthode

Implement IDisposable. Do not make this method virtual. A derived class should not be able to override this method.
public Dispose ( ) : void
Résultat void

ExpectInitialOfferMessage() public méthode

Expect the INITIAL_OFFER_MESSAGE request from the client.
/// Throw when no INITIAL_OFFER_MESSAGE request from the client. ///
public ExpectInitialOfferMessage ( string ipaddress, System.TimeSpan timeout ) : INITIAL_OFFER_MESSAGE
ipaddress string The expected ipAddress of the remote endpoint which send request.
timeout System.TimeSpan The waiting timeout.
Résultat INITIAL_OFFER_MESSAGE

ExpectSegmentInfoMessage() public méthode

Expect the SEGMENT_INFO_MESSAGE request from the client.
/// Throw when no SEGMENT_INFO_MESSAGE request from the client. ///
public ExpectSegmentInfoMessage ( string ipaddress, System.TimeSpan timeout ) : SEGMENT_INFO_MESSAGE
ipaddress string The expected ipAddress of the remote endpoint which send request.
timeout System.TimeSpan The waiting timeout.
Résultat SEGMENT_INFO_MESSAGE

PCHCServer() public méthode

Initializes a new instance of the PCHCServer class with the default transport type: Https; hosted cache server listen port: 443; IPAddress type: IPv4;
public PCHCServer ( ) : System
Résultat System

PCHCServer() public méthode

Initializes a new instance of the PCHCServer class with specified logger instance and the default transport type: Https; hosted cache server listen port: 443; IPAddress type: IPv4;
public PCHCServer ( ILogPrinter logger ) : System
logger ILogPrinter The logger.
Résultat System

PCHCServer() public méthode

Initializes a new instance of the PCHCServer class with the specified osted Cache Mode Listen Port and IPAddress type.
public PCHCServer ( TransferProtocol transferProtocol, int hostedCacheModeListenPort, IPAddressType ipaddressType ) : System
transferProtocol TransferProtocol The transport type will be used
hostedCacheModeListenPort int /// The specified BranchCache service's listen port in hosted cache mode. ///
ipaddressType IPAddressType The IP address type.
Résultat System

PCHCServer() public méthode

Initializes a new instance of the PCHCServer class with the specified osted Cache Mode Listen Port and IPAddress type.
public PCHCServer ( TransferProtocol transferProtocol, int hostedCacheModeListenPort, IPAddressType ipaddressType, ILogPrinter logger ) : System
transferProtocol TransferProtocol The transport type will be used
hostedCacheModeListenPort int /// The specified BranchCache service's listen port in hosted cache mode. ///
ipaddressType IPAddressType The IP address type.
logger ILogPrinter The logger.
Résultat System

SendHttpStatusCode401() public méthode

Send http status code 401.
public SendHttpStatusCode401 ( ) : void
Résultat void

SendPackage() public méthode

Send Reponse Message to the client.
public SendPackage ( RESPONSE_MESSAGE responseMessage ) : void
responseMessage RESPONSE_MESSAGE The response message.
Résultat void

Start() public méthode

Start the http server process to listen and receive and http request.
public Start ( ) : void
Résultat void

Stop() public méthode

Stop the http server process and Release this object resources.
public Stop ( ) : void
Résultat void