C# Class ModServer.HttpEngine

Inheritance: HelperClass
Datei anzeigen Open project: tyandjel94/RowanParkingPassApp

Public Properties

Property Type Description
PAGE_NOT_FOUND String
PAGE_ROOT String
PAGE_SIGN_IN String
pageMutations string>.Dictionary

Public Methods

Method Description
HttpEngine ( Stream networkStream, TcpClient client ) : System
addPageMutation ( string placeholder, string replacement ) : bool
process ( String strmessage, byte message ) : void

Protected Methods

Method Description
on404 ( HttpRequest request ) : void
onInit ( HttpRequest request ) : String
processGet ( HttpRequest request ) : bool

This method checks that the request path exists in the PAGE_ROOT directory. Then the content-type is parsed from the request. An HttpRequest is generated and sent, followed by the file specified. Call this method conditionally from any subclass unless there are no conditions as to what clients are permitted to GET.

processHead ( HttpRequest request ) : bool
processPost ( HttpRequest request ) : void
writeHtmlStream ( Stream s, HttpResponse response ) : void
writeStream ( Stream s, HttpResponse response ) : void

Method Details

HttpEngine() public method

public HttpEngine ( Stream networkStream, TcpClient client ) : System
networkStream Stream
client System.Net.Sockets.TcpClient
return System

addPageMutation() public static method

public static addPageMutation ( string placeholder, string replacement ) : bool
placeholder string
replacement string
return bool

on404() protected abstract method

protected abstract on404 ( HttpRequest request ) : void
request HttpRequest
return void

onInit() protected abstract method

protected abstract onInit ( HttpRequest request ) : String
request HttpRequest
return String

process() public method

public process ( String strmessage, byte message ) : void
strmessage String
message byte
return void

processGet() protected method

This method checks that the request path exists in the PAGE_ROOT directory. Then the content-type is parsed from the request. An HttpRequest is generated and sent, followed by the file specified. Call this method conditionally from any subclass unless there are no conditions as to what clients are permitted to GET.
protected processGet ( HttpRequest request ) : bool
request HttpRequest
return bool

processHead() protected method

protected processHead ( HttpRequest request ) : bool
request HttpRequest
return bool

processPost() protected method

protected processPost ( HttpRequest request ) : void
request HttpRequest
return void

writeHtmlStream() protected method

protected writeHtmlStream ( Stream s, HttpResponse response ) : void
s Stream
response HttpResponse
return void

writeStream() protected method

protected writeStream ( Stream s, HttpResponse response ) : void
s Stream
response HttpResponse
return void

Property Details

PAGE_NOT_FOUND public_oe static_oe property

public static String PAGE_NOT_FOUND
return String

PAGE_ROOT public_oe static_oe property

public static String PAGE_ROOT
return String

PAGE_SIGN_IN public_oe static_oe property

public static String PAGE_SIGN_IN
return String

pageMutations public_oe static_oe property

public static Dictionary pageMutations
return string>.Dictionary