# PHTTPServiceProcess Class Reference

`#include <httpsvc.h>`

Inheritance diagram for PHTTPServiceProcess:

List of all members.

## Public Types

| MaxSecuredKeys = 10
enum | { MaxSecuredKeys = 10 }

## Public Member Functions

| PHTTPServiceProcess (const Info &inf)
| ~PHTTPServiceProcess ()
PBoolean | OnStart ()
| Called when the service is started.
void | OnStop ()
| Called by the system when the service is stopped.
PBoolean | OnPause ()
| Called by the system when the service is to be paused.
void | OnContinue ()
| Resume after the service was paused.
const char * | GetServiceDependencies () const
virtual void | OnConfigChanged ()=0
virtual PBoolean | Initialise (const char *initMsg)=0
PBoolean | ListenForHTTP (WORD port, PSocket::Reusability reuse=PSocket::CanReuseAddress, PINDEX stackSize=0x4000)
PBoolean | ListenForHTTP (PSocket *listener, PSocket::Reusability reuse=PSocket::CanReuseAddress, PINDEX stackSize=0x4000)
virtual PString | GetPageGraphic ()
void | GetPageHeader (PHTML &)
void | GetPageHeader (PHTML &, const PString &title)
virtual PString | GetCopyrightText ()
const PString & | GetMacroKeyword () const
const PTime & | GetCompilationDate () const
const PString & | GetHomePage () const
const PString & | GetEMailAddress () const
const PString & | GetProductName () const
const PTEACypher::Key & | GetProductKey () const
const PStringArray & | GetSecuredKeys () const
const PTEACypher::Key & | GetSignatureKey () const
PBoolean | ShouldIgnoreSignatures () const
void | SetIgnoreSignatures (PBoolean ig)
virtual void | AddRegisteredText (PHTML &html)
virtual void | AddUnregisteredText (PHTML &html)
virtual PBoolean | SubstituteEquivalSequence (PHTTPRequest &request, const PString &, PString &)
virtual PHTTPServer * | CreateHTTPServer (PTCPSocket &socket)
virtual PHTTPServer * | OnCreateHTTPServer (const PHTTPSpace &urlSpace)
PTCPSocket * | AcceptHTTP ()
PBoolean | ProcessHTTP (PTCPSocket &socket)

## Static Public Member Functions

static PHTTPServiceProcess & | Current ()
| Get the current service process object.

## Protected Member Functions

void | ShutdownListener ()
void | BeginRestartSystem ()
void | CompleteRestartSystem ()
| PLIST (ThreadList, PHTTPServiceThread)

## Protected Attributes

PSocket * | httpListeningSocket
PHTTPSpace | httpNameSpace
PString | macroKeyword
PTEACypher::Key | productKey
PStringArray | securedKeys
PTEACypher::Key | signatureKey
PBoolean | ignoreSignatures
PTime | compilationDate
PString | manufacturersHomePage
PString | manufacturersEmail
PString | productNameHTML
PString | gifHTML
PString | copyrightHolder
PString | copyrightHomePage
PString | copyrightEmail
PThread * | restartThread
ThreadList | httpThreads
PMutex | httpThreadsMutex

## Classes

struct | Info

## Member Enumeration Documentation

anonymous enum

Enumerator:

  MaxSecuredKeys |

## Constructor & Destructor Documentation

PHTTPServiceProcess::PHTTPServiceProcess | ( | const Info & | inf | ) |

PHTTPServiceProcess::~PHTTPServiceProcess | ( |  | ) |

## Member Function Documentation

PTCPSocket* PHTTPServiceProcess::AcceptHTTP | ( |  | ) |

virtual void PHTTPServiceProcess::AddRegisteredText | ( | PHTML & | html | ) | `[virtual]`

virtual void PHTTPServiceProcess::AddUnregisteredText | ( | PHTML & | html | ) | `[virtual]`

void PHTTPServiceProcess::BeginRestartSystem | ( |  | ) | `[protected]`

void PHTTPServiceProcess::CompleteRestartSystem | ( |  | ) | `[protected]`

virtual PHTTPServer* PHTTPServiceProcess::CreateHTTPServer | ( | PTCPSocket & | socket | ) | `[virtual]`

Reimplemented in PSecureHTTPServiceProcess.

static PHTTPServiceProcess& PHTTPServiceProcess::Current | ( |  | ) | `[static]`

Get the current service process object.

Returns:
  Pointer to service process.

Reimplemented from PServiceProcess.

const PTime& PHTTPServiceProcess::GetCompilationDate | ( |  | ) | const`[inline]`

virtual PString PHTTPServiceProcess::GetCopyrightText | ( |  | ) | `[virtual]`

const PString& PHTTPServiceProcess::GetEMailAddress | ( |  | ) | const`[inline]`

const PString& PHTTPServiceProcess::GetHomePage | ( |  | ) | const`[inline]`

const PString& PHTTPServiceProcess::GetMacroKeyword | ( |  | ) | const`[inline]`

virtual PString PHTTPServiceProcess::GetPageGraphic | ( |  | ) | `[virtual]`

void PHTTPServiceProcess::GetPageHeader | ( | PHTML & | ,
|  | const PString & | title |
| ) |  |  |

void PHTTPServiceProcess::GetPageHeader | ( | PHTML & |  | ) |

const PTEACypher::Key& PHTTPServiceProcess::GetProductKey | ( |  | ) | const`[inline]`

const PString& PHTTPServiceProcess::GetProductName | ( |  | ) | const`[inline]`

const PStringArray& PHTTPServiceProcess::GetSecuredKeys | ( |  | ) | const`[inline]`

const char* PHTTPServiceProcess::GetServiceDependencies | ( |  | ) | const

const PTEACypher::Key& PHTTPServiceProcess::GetSignatureKey | ( |  | ) | const`[inline]`

virtual PBoolean PHTTPServiceProcess::Initialise | ( | const char * | initMsg | ) | `[pure virtual]`

PBoolean PHTTPServiceProcess::ListenForHTTP | ( | PSocket * | listener,
|  | PSocket::Reusability | reuse = `PSocket::CanReuseAddress`,
|  | PINDEX | stackSize = `0x4000` |
| ) |  |  |

PBoolean PHTTPServiceProcess::ListenForHTTP | ( | WORD | port,
|  | PSocket::Reusability | reuse = `PSocket::CanReuseAddress`,
|  | PINDEX | stackSize = `0x4000` |
| ) |  |  |

virtual void PHTTPServiceProcess::OnConfigChanged | ( |  | ) | `[pure virtual]`

void PHTTPServiceProcess::OnContinue | ( |  | ) | `[virtual]`

Resume after the service was paused.

Reimplemented from PServiceProcess.

virtual PHTTPServer* PHTTPServiceProcess::OnCreateHTTPServer | ( | const PHTTPSpace & | urlSpace | ) | `[virtual]`

PBoolean PHTTPServiceProcess::OnPause | ( |  | ) | `[virtual]`

Called by the system when the service is to be paused.

This will suspend any actions that the service may be executing. Usually this is less expensive in resource allocation etc than stopping and starting the service.

Returns:
  true if the service was successfully paused.

Reimplemented from PServiceProcess.

PBoolean PHTTPServiceProcess::OnStart | ( |  | ) | `[virtual]`

Called when the service is started.

This typically initialises the service and returns true if the service is ready to run. The `Main()` function is then executed.

Returns:
  true if service may start, false if an initialisation failure occurred.

Implements PServiceProcess.

void PHTTPServiceProcess::OnStop | ( |  | ) | `[virtual]`

Called by the system when the service is stopped.

One return from this function there is no guarentee that any more user code will be executed. Any cleaning up or closing of resource must be done in here.

Reimplemented from PServiceProcess.

PHTTPServiceProcess::PLIST | ( | ThreadList | ,
|  | PHTTPServiceThread |  |
| ) |  |  | `[protected]`

PBoolean PHTTPServiceProcess::ProcessHTTP | ( | PTCPSocket & | socket | ) |

void PHTTPServiceProcess::SetIgnoreSignatures | ( | PBoolean | ig | ) | `[inline]`

PBoolean PHTTPServiceProcess::ShouldIgnoreSignatures | ( |  | ) | const`[inline]`

void PHTTPServiceProcess::ShutdownListener | ( |  | ) | `[protected]`

virtual PBoolean PHTTPServiceProcess::SubstituteEquivalSequence | ( | PHTTPRequest & | request,
|  | const PString & | ,
|  | PString & |  |
| ) |  |  | `[virtual]`

## Member Data Documentation

PTime PHTTPServiceProcess::compilationDate `[protected]`

PString PHTTPServiceProcess::copyrightEmail `[protected]`

PString PHTTPServiceProcess::copyrightHolder `[protected]`

PString PHTTPServiceProcess::copyrightHomePage `[protected]`

PString PHTTPServiceProcess::gifHTML `[protected]`

PSocket* PHTTPServiceProcess::httpListeningSocket `[protected]`

PHTTPSpace PHTTPServiceProcess::httpNameSpace `[protected]`

ThreadList PHTTPServiceProcess::httpThreads `[protected]`

PMutex PHTTPServiceProcess::httpThreadsMutex `[protected]`

PBoolean PHTTPServiceProcess::ignoreSignatures `[protected]`

PString PHTTPServiceProcess::macroKeyword `[protected]`

PString PHTTPServiceProcess::manufacturersEmail `[protected]`

PString PHTTPServiceProcess::manufacturersHomePage `[protected]`

PTEACypher::Key PHTTPServiceProcess::productKey `[protected]`

PString PHTTPServiceProcess::productNameHTML `[protected]`

PThread* PHTTPServiceProcess::restartThread `[protected]`

PStringArray PHTTPServiceProcess::securedKeys `[protected]`

PTEACypher::Key PHTTPServiceProcess::signatureKey `[protected]`

The documentation for this class was generated from the following file:

- httpsvc.h