C# Class Incog.Servers.HttpProcessor

Simple Hypertext Transfer Protocol (HTTP) request processor.
显示文件 Open project: SimWitty/Incog Class Usage Examples

Public Methods

Method Description
HttpProcessor ( TcpClient socket, HttpServer server ) : System

Initializes a new instance of the HttpProcessor class.

Process ( ) : void

Process incoming requests.

WriteFailure ( ) : void

Write a HTTP failure (500).

WriteLine ( string value ) : void

Write a single line of ASCII text followed by the new line character.

WriteSuccess ( ) : void

Write an HTTP success (200).

Private Methods

Method Description
ParseHeaders ( ) : void

Parse the headers.

ParseRequest ( ) : void

Parse the request to load the method, URL, and protocol.

ReadLine ( ) : string

Read the next line from the HTTP request.

Method Details

HttpProcessor() public method

Initializes a new instance of the HttpProcessor class.
public HttpProcessor ( TcpClient socket, HttpServer server ) : System
socket System.Net.Sockets.TcpClient Pass in the client socket.
server HttpServer Pass in the HTTP server.
return System

Process() public method

Process incoming requests.
public Process ( ) : void
return void

WriteFailure() public method

Write a HTTP failure (500).
public WriteFailure ( ) : void
return void

WriteLine() public method

Write a single line of ASCII text followed by the new line character.
public WriteLine ( string value ) : void
value string The string in ASCII format.
return void

WriteSuccess() public method

Write an HTTP success (200).
public WriteSuccess ( ) : void
return void