C# Class ServiceStack.WebHost.Endpoints.Support.HttpListenerBase

Wrapper class for the HTTPListener to allow easier access to the server, for start and stop management and event routing of the actual inbound requests.
Inheritance: IDisposable
Mostra file Open project: firstsee/ServiceStack Class Usage Examples

Protected Properties

Property Type Description
IsStarted bool
Listener System.Net.HttpListener

Public Methods

Method Description
Configure ( Funq.Container container ) : void
Dispose ( ) : void
Init ( ) : void
Start ( string urlBase ) : void

Starts the Web Service

Stop ( ) : void

Shut down the Web Service

Protected Methods

Method Description
HttpListenerBase ( ) : System
HttpListenerBase ( string serviceName ) : System
ProcessRequest ( HttpListenerContext context ) : void

Overridable method that can be used to implement a custom hnandler

SetConfig ( EndpointHostConfig config ) : void
WebRequestCallback ( IAsyncResult result ) : void

Private Methods

Method Description
WriteException ( HttpListenerContext context, Exception ex ) : void

Method Details

Configure() public abstract method

public abstract Configure ( Funq.Container container ) : void
container Funq.Container
return void

Dispose() public method

public Dispose ( ) : void
return void

HttpListenerBase() protected method

protected HttpListenerBase ( ) : System
return System

HttpListenerBase() protected method

protected HttpListenerBase ( string serviceName ) : System
serviceName string
return System

Init() public method

public Init ( ) : void
return void

ProcessRequest() protected abstract method

Overridable method that can be used to implement a custom hnandler
protected abstract ProcessRequest ( HttpListenerContext context ) : void
context System.Net.HttpListenerContext
return void

SetConfig() protected method

protected SetConfig ( EndpointHostConfig config ) : void
config EndpointHostConfig
return void

Start() public method

Starts the Web Service
public Start ( string urlBase ) : void
urlBase string /// A Uri that acts as the base that the server is listening on. /// Format should be: http://127.0.0.1:8080/ or http://127.0.0.1:8080/somevirtual/ /// Note: the trailing backslash is required! For more info see the /// HttpListener.Prefixes property on MSDN. ///
return void

Stop() public method

Shut down the Web Service
public Stop ( ) : void
return void

WebRequestCallback() protected method

protected WebRequestCallback ( IAsyncResult result ) : void
result IAsyncResult
return void

Property Details

IsStarted protected_oe property

protected bool IsStarted
return bool

Listener protected_oe property

protected HttpListener,System.Net Listener
return System.Net.HttpListener