C# Class Microsoft.Protocols.TestTools.StackSdk.CommonStack.HttpServerTransport

The http server side.
Inheritance: IDisposable
Afficher le fichier Open project: Microsoft/WindowsProtocolTestSuites Class Usage Examples

Méthodes publiques

Méthode Description
Dispose ( ) : void

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

HttpServerTransport ( TransferProtocol transferProtocol, int listenPort, IPAddressType ipaddressType, string resource ) : System

Initializes a new instance of the HttpServerTransport class.

HttpServerTransport ( TransferProtocol transferProtocol, int listenPort, IPAddressType ipaddressType, string resource, ILogPrinter logger ) : System

Initializes a new instance of the HttpServerTransport class.

HttpServerTransport ( TransferProtocol transferProtocol, int listenPort, string resource ) : System

Initializes a new instance of the HttpServerTransport class.

Send ( string>.Dictionary header, byte payLoadData, HttpListenerContext httpListenerContext ) : void

Send the response message.

Send ( int statusCode, string>.Dictionary header, byte payLoadData, HttpListenerContext httpListenerContext, bool needNextRequest ) : void

Send the response message.

StartHttpServer ( ) : void

Start http server to listen and receive the http request.

StopHttpServer ( ) : void

Stop http server to listen and receive the http request.

Private Methods

Méthode 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. 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

GetListenPrefix ( TransferProtocol transferProtocol, int hostedCacheModeListenPort, string resource ) : string

Get the listen prefix.

HttpRequestManagerStart ( ) : void

The thread start method for http request manager thread.

RaiseIncomingRequest ( HttpListenerContext context ) : void

The event handle for the received http request.

Method Details

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

HttpServerTransport() public méthode

Initializes a new instance of the HttpServerTransport class.
public HttpServerTransport ( TransferProtocol transferProtocol, int listenPort, IPAddressType ipaddressType, string resource ) : System
transferProtocol TransferProtocol The transport type will be used
listenPort int The listen port.
ipaddressType IPAddressType The IP address type.
resource string The resource.
Résultat System

HttpServerTransport() public méthode

Initializes a new instance of the HttpServerTransport class.
public HttpServerTransport ( TransferProtocol transferProtocol, int listenPort, IPAddressType ipaddressType, string resource, ILogPrinter logger ) : System
transferProtocol TransferProtocol The transport type will be used
listenPort int The listen port.
ipaddressType IPAddressType The IP address type.
resource string The resource.
logger ILogPrinter The logger.
Résultat System

HttpServerTransport() public méthode

Initializes a new instance of the HttpServerTransport class.
public HttpServerTransport ( TransferProtocol transferProtocol, int listenPort, string resource ) : System
transferProtocol TransferProtocol The transport type will be used
listenPort int The listen port.
resource string The resource.
Résultat System

Send() public méthode

Send the response message.
public Send ( string>.Dictionary header, byte payLoadData, HttpListenerContext httpListenerContext ) : void
header string>.Dictionary Http header.
payLoadData byte The payload data.
httpListenerContext System.Net.HttpListenerContext The payload data.
Résultat void

Send() public méthode

Send the response message.
public Send ( int statusCode, string>.Dictionary header, byte payLoadData, HttpListenerContext httpListenerContext, bool needNextRequest ) : void
statusCode int Status code.
header string>.Dictionary Http header.
payLoadData byte The payload data.
httpListenerContext System.Net.HttpListenerContext The http listener context.
needNextRequest bool Whether need next request before sending response.
Résultat void

StartHttpServer() public méthode

Start http server to listen and receive the http request.
Represents Exception about the Thread State Unable to start the request handling process in 10 seconds
public StartHttpServer ( ) : void
Résultat void

StopHttpServer() public méthode

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