C# 클래스 Microsoft.Protocols.TestTools.StackSdk.BranchCache.Pchc.PCHCServer

The PCHC server class which is used to exchange the pchc message between the client.
상속: IDisposable
파일 보기 프로젝트 열기: Microsoft/WindowsProtocolTestSuites 1 사용 예제들

공개 메소드들

메소드 설명
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.

비공개 메소드들

메소드 설명
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.

메소드 상세

CreateResponseMessage() 공개 메소드

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 ///
리턴 RESPONSE_MESSAGE

Dispose() 공개 메소드

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

ExpectInitialOfferMessage() 공개 메소드

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.
리턴 INITIAL_OFFER_MESSAGE

ExpectSegmentInfoMessage() 공개 메소드

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.
리턴 SEGMENT_INFO_MESSAGE

PCHCServer() 공개 메소드

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
리턴 System

PCHCServer() 공개 메소드

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.
리턴 System

PCHCServer() 공개 메소드

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.
리턴 System

PCHCServer() 공개 메소드

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.
리턴 System

SendHttpStatusCode401() 공개 메소드

Send http status code 401.
public SendHttpStatusCode401 ( ) : void
리턴 void

SendPackage() 공개 메소드

Send Reponse Message to the client.
public SendPackage ( RESPONSE_MESSAGE responseMessage ) : void
responseMessage RESPONSE_MESSAGE The response message.
리턴 void

Start() 공개 메소드

Start the http server process to listen and receive and http request.
public Start ( ) : void
리턴 void

Stop() 공개 메소드

Stop the http server process and Release this object resources.
public Stop ( ) : void
리턴 void