C# Class Universe.Framework.Servers.HttpServer.BaseHttpServer

Inheritance: IHttpServer, IDisposable
Show file Open project: Virtual-Universe/Virtual-Universe Class Usage Examples

Public Properties

Property Type Description
HTTPDRunning bool
OnOverrideRequest Action

Protected Properties

Property Type Description
NotSocketErrors int
m_hostName string
m_internalServer HttpListenerManager
m_isSecure bool
m_listenIPAddress System.Net.IPAddress
m_pollHandlers PollServiceEventArgs>.Dictionary
m_port uint
m_rpcHandlers XmlRpcMethod>.Dictionary
m_streamHandlers IStreamedRequestHandler>.Dictionary

Private Properties

Property Type Description
GetHTTP404 string
GetHTTP500 string
GetHandlerKey string
HandleXmlRpcRequests byte[]
OnRequest void
TryGetPollServiceHTTPHandler bool
TryGetStreamHandler bool
getDefaultHTTP404 string
getDefaultHTTP500 string

Public Methods

Method Description
AddPollServiceHTTPHandler ( string methodName, PollServiceEventArgs args ) : bool
AddStreamHandler ( IStreamedRequestHandler handler ) : void

Add a stream handler to the http server. If the handler already exists, then nothing happens.

AddXmlRPCHandler ( string method, XmlRpcMethod handler ) : bool
BaseHttpServer ( uint port, string hostName, bool isSecure, uint threadCount ) : System
Dispose ( ) : void
GetHTML404 ( OSHttpResponse response ) : byte[]
GetHTML500 ( HttpListenerResponse response ) : byte[]
GetXmlRPCHandler ( string method ) : XmlRpcMethod
HandleRequest ( HttpListenerContext context ) : void

This methods is the start of incoming HTTP request handling.

RemovePollServiceHTTPHandler ( string httpMethod, string path ) : void
RemoveStreamHandler ( string httpMethod, string path ) : void
RemoveXmlRPCHandler ( string method ) : void
Start ( ) : void
Stop ( ) : void

Private Methods

Method Description
GetHTTP404 ( ) : string
GetHTTP500 ( ) : string
GetHandlerKey ( string httpMethod, string path ) : string
HandleXmlRpcRequests ( OSHttpRequest request, OSHttpResponse response ) : byte[]

Try all the registered xmlrpc handlers when an xmlrpc request is received. Sends back an XMLRPC unknown request response if no handler is registered for the requested method.

OnRequest ( HttpListenerContext context ) : void
TryGetPollServiceHTTPHandler ( string handlerKey, PollServiceEventArgs &oServiceEventArgs ) : bool
TryGetStreamHandler ( string handlerKey, IStreamedRequestHandler &streamHandler ) : bool
getDefaultHTTP404 ( ) : string
getDefaultHTTP500 ( ) : string

Method Details

AddPollServiceHTTPHandler() public method

public AddPollServiceHTTPHandler ( string methodName, PollServiceEventArgs args ) : bool
methodName string
args PollServiceEventArgs
return bool

AddStreamHandler() public method

Add a stream handler to the http server. If the handler already exists, then nothing happens.
public AddStreamHandler ( IStreamedRequestHandler handler ) : void
handler IStreamedRequestHandler
return void

AddXmlRPCHandler() public method

public AddXmlRPCHandler ( string method, XmlRpcMethod handler ) : bool
method string
handler XmlRpcMethod
return bool

BaseHttpServer() public method

public BaseHttpServer ( uint port, string hostName, bool isSecure, uint threadCount ) : System
port uint
hostName string
isSecure bool
threadCount uint
return System

Dispose() public method

public Dispose ( ) : void
return void

GetHTML404() public method

public GetHTML404 ( OSHttpResponse response ) : byte[]
response Universe.Framework.Servers.HttpServer.Implementation.OSHttpResponse
return byte[]

GetHTML500() public method

public GetHTML500 ( HttpListenerResponse response ) : byte[]
response System.Net.HttpListenerResponse
return byte[]

GetXmlRPCHandler() public method

public GetXmlRPCHandler ( string method ) : XmlRpcMethod
method string
return XmlRpcMethod

HandleRequest() public method

This methods is the start of incoming HTTP request handling.
public HandleRequest ( HttpListenerContext context ) : void
context System.Net.HttpListenerContext
return void

RemovePollServiceHTTPHandler() public method

public RemovePollServiceHTTPHandler ( string httpMethod, string path ) : void
httpMethod string
path string
return void

RemoveStreamHandler() public method

public RemoveStreamHandler ( string httpMethod, string path ) : void
httpMethod string
path string
return void

RemoveXmlRPCHandler() public method

public RemoveXmlRPCHandler ( string method ) : void
method string
return void

Start() public method

public Start ( ) : void
return void

Stop() public method

public Stop ( ) : void
return void

Property Details

HTTPDRunning public property

public bool HTTPDRunning
return bool

NotSocketErrors protected property

protected int NotSocketErrors
return int

OnOverrideRequest public property

public Action OnOverrideRequest
return Action

m_hostName protected property

protected string m_hostName
return string

m_internalServer protected property

protected HttpListenerManager,Universe.Framework.Servers.HttpServer m_internalServer
return HttpListenerManager

m_isSecure protected property

protected bool m_isSecure
return bool

m_listenIPAddress protected property

protected IPAddress,System.Net m_listenIPAddress
return System.Net.IPAddress

m_pollHandlers protected property

protected Dictionary m_pollHandlers
return PollServiceEventArgs>.Dictionary

m_port protected property

protected uint m_port
return uint

m_rpcHandlers protected property

protected Dictionary m_rpcHandlers
return XmlRpcMethod>.Dictionary

m_streamHandlers protected property

protected Dictionary m_streamHandlers
return IStreamedRequestHandler>.Dictionary