THTTPListener

From Ultibo.org
Jump to: navigation, search

Return to Unit HTTP


Description


To be documented

Class definitions



THTTPListener = class(TWinsock2TCPListener)

public
constructor Create;  
destructor Destroy; override;  
private
FLock:TCriticalSectionHandle;  
 
FHost:THTTPHost; Default Host
FHosts:TLinkedList;  
 
FServer:String;  
 
function GetServer:String;  
procedure SetServer(const AServer:String);  
protected
function AcquireLock:Boolean;  
function ReleaseLock:Boolean;  
 
procedure DoConnect(AThread:TWinsock2TCPServerThread); override;  
procedure DoDisconnect(AThread:TWinsock2TCPServerThread); override;  
 
function DoExecute(AThread:TWinsock2TCPServerThread):Boolean; override;  
 
function MatchHost(const AName:String; var AAlias:THTTPAlias):THTTPHost;  
 
function GetRequestLine(AThread:TWinsock2TCPServerThread; ARequest:THTTPServerRequest):Boolean;  
function GetRequestHeaders(AThread:TWinsock2TCPServerThread; ARequest:THTTPServerRequest):Boolean;  
function GetRequestContentStream(AThread:TWinsock2TCPServerThread; ARequest:THTTPServerRequest; AContent:TStream; ASize:LongWord):Boolean;  
function GetRequestContentString(AThread:TWinsock2TCPServerThread; ARequest:THTTPServerRequest; var AContent:String; ASize:LongWord):Boolean;  
 
function SendResponseLine(AThread:TWinsock2TCPServerThread; AResponse:THTTPServerResponse):Boolean;  
function SendResponseHeaders(AThread:TWinsock2TCPServerThread; AResponse:THTTPServerResponse):Boolean;  
function SendResponseContentStream(AThread:TWinsock2TCPServerThread; AResponse:THTTPServerResponse; AContent:TStream; ASize:LongWord):Boolean;  
function SendResponseContentString(AThread:TWinsock2TCPServerThread; AResponse:THTTPServerResponse; const AContent:String; ASize:LongWord):Boolean;  
public
property Server:String read GetServer write SetServer;  
 
function FindHost(const AName:String):THTTPHost;  
 
function RegisterHost(AHost:THTTPHost):Boolean;  
function DeregisterHost(AHost:THTTPHost):Boolean;  
 
function FindError(const AHost:String; AStatus:LongWord):THTTPError;  
 
function RegisterError(const AHost:String; AError:THTTPError):Boolean;  
function DeregisterError(const AHost:String; AError:THTTPError):Boolean;  
 
function GetModule(const AHost:String; APrevious:THTTPModule):THTTPModule;  
function FindModule(const AHost:String; AModule:THTTPModule):THTTPModule;  
 
function RegisterModule(const AHost:String; AModule:THTTPModule):Boolean;  
function DeregisterModule(const AHost:String; AModule:THTTPModule):Boolean;  
 
function FindDocument(const AHost,AName:String):THTTPDocument;  
 
function RegisterDocument(const AHost:String; ADocument:THTTPDocument):Boolean;  
function DeregisterDocument(const AHost:String; ADocument:THTTPDocument):Boolean;  
 
function LoadMimeTypes(const AHost:String):Boolean;  
 
function FindMimeType(const AHost,AExtension:String):THTTPMimeType;  
function ResolveMimeType(const AHost,AExtension:String):String;  
 
function RegisterMimeType(const AHost:String; AMimeType:THTTPMimeType):Boolean;  
function DeregisterMimeType(const AHost:String; AMimeType:THTTPMimeType):Boolean;  


Function declarations



constructor THTTPListener.Create;
Description: To be documented
Note None documented


destructor THTTPListener.Destroy;
Description: To be documented
Note None documented


function THTTPListener.GetServer:String;
Description: To be documented
Note None documented


procedure THTTPListener.SetServer(const AServer:String);
Description: To be documented
Note None documented


function THTTPListener.AcquireLock:Boolean;
Description: To be documented
Note None documented


function THTTPListener.ReleaseLock:Boolean;
Description: To be documented
Note None documented


procedure THTTPListener.DoConnect(AThread:TWinsock2TCPServerThread);
Description: To be documented
Note None documented


procedure THTTPListener.DoDisconnect(AThread:TWinsock2TCPServerThread);
Description: To be documented
Note None documented


function THTTPListener.DoExecute(AThread:TWinsock2TCPServerThread):Boolean;
Description: To be documented
Note None documented


function THTTPListener.MatchHost(const AName:String; var AAlias:THTTPAlias):THTTPHost;
Description: To be documented
Note None documented


function THTTPListener.GetRequestLine(AThread:TWinsock2TCPServerThread; ARequest:THTTPServerRequest):Boolean;
Description: To be documented
Note None documented


function THTTPListener.GetRequestHeaders(AThread:TWinsock2TCPServerThread; ARequest:THTTPServerRequest):Boolean;
Description: To be documented
Note None documented


function THTTPListener.GetRequestContentStream(AThread:TWinsock2TCPServerThread; ARequest:THTTPServerRequest; AContent:TStream; ASize:LongWord):Boolean;
Description: If Size is 0 then read the entire content to the stream
Note None documented


function THTTPListener.GetRequestContentString(AThread:TWinsock2TCPServerThread; ARequest:THTTPServerRequest; var AContent:String; ASize:LongWord):Boolean;
Description: If Size is 0 then read the entire content to the string
Note None documented


function THTTPListener.SendResponseLine(AThread:TWinsock2TCPServerThread; AResponse:THTTPServerResponse):Boolean;
Description: To be documented
Note None documented


function THTTPListener.SendResponseHeaders(AThread:TWinsock2TCPServerThread; AResponse:THTTPServerResponse):Boolean;
Description: To be documented
Note None documented


function THTTPListener.SendResponseContentStream(AThread:TWinsock2TCPServerThread; AResponse:THTTPServerResponse; AContent:TStream; ASize:LongWord):Boolean;
Description: To be documented
Note None documented


function THTTPListener.SendResponseContentString(AThread:TWinsock2TCPServerThread; AResponse:THTTPServerResponse; const AContent:String; ASize:LongWord):Boolean;
Description: To be documented
Note None documented


function THTTPListener.FindHost(const AName:String):THTTPHost;
Description: To be documented
Note None documented


function THTTPListener.RegisterHost(AHost:THTTPHost):Boolean;
Description: To be documented
Note None documented


function THTTPListener.DeregisterHost(AHost:THTTPHost):Boolean;
Description: To be documented
Note None documented


function THTTPListener.FindError(const AHost:String; AStatus:LongWord):THTTPError;
Description: To be documented
Note None documented


function THTTPListener.RegisterError(const AHost:String; AError:THTTPError):Boolean;
Description: To be documented
Note None documented


function THTTPListener.DeregisterError(const AHost:String; AError:THTTPError):Boolean;
Description: To be documented
Note None documented


function THTTPListener.GetModule(const AHost:String; APrevious:THTTPModule):THTTPModule;
Description: To be documented
Note None documented


function THTTPListener.FindModule(const AHost:String; AModule:THTTPModule):THTTPModule;
Description: To be documented
Note None documented


function THTTPListener.RegisterModule(const AHost:String; AModule:THTTPModule):Boolean;
Description: To be documented
Note None documented


function THTTPListener.DeregisterModule(const AHost:String; AModule:THTTPModule):Boolean;
Description: To be documented
Note None documented


function THTTPListener.FindDocument(const AHost,AName:String):THTTPDocument;
Description: To be documented
Note None documented


function THTTPListener.RegisterDocument(const AHost:String; ADocument:THTTPDocument):Boolean;
Description: To be documented
Note None documented


function THTTPListener.DeregisterDocument(const AHost:String; ADocument:THTTPDocument):Boolean;
Description: To be documented
Note None documented


function THTTPListener.LoadMimeTypes(const AHost:String):Boolean;
Description: To be documented
Note None documented


function THTTPListener.FindMimeType(const AHost,AExtension:String):THTTPMimeType;
Description: To be documented
Note None documented


function THTTPListener.ResolveMimeType(const AHost,AExtension:String):String;
Description: To be documented
Note None documented


function THTTPListener.RegisterMimeType(const AHost:String; AMimeType:THTTPMimeType):Boolean;
Description: To be documented
Note None documented


function THTTPListener.DeregisterMimeType(const AHost:String; AMimeType:THTTPMimeType):Boolean;
Description: To be documented
Note None documented


Return to Unit Reference