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

The http server side.
Inheritance: IDisposable
Datei anzeigen Open project: Microsoft/WindowsProtocolTestSuites Class Usage Examples

Public Methods

Method 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

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

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

HttpServerTransport() public method

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

HttpServerTransport() public method

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

HttpServerTransport() public method

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

Send() public method

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

Send() public method

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

StartHttpServer() public method

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
return void

StopHttpServer() public method

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