MOOS 0.2375
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
CHTTPConnection Class Reference

#include <HTTPConnection.h>

Collaboration diagram for CHTTPConnection:
Collaboration graph
[legend]

List of all members.

Classes

struct  HTTPRequest

Public Member Functions

 CHTTPConnection (XPCTcpSocket *pNewSocket, CMOOSCommClient *pMOOSComms, CMOOSLock *pMOOSCommsLock)
bool Run ()
bool HasCompleted ()

Static Public Member Functions

static bool _CB (void *pParam)

Protected Member Functions

bool Serve ()
bool MakeWebPage ()
bool SendHeader ()
bool SendFailureHeader ()
bool SendWebPage ()
bool HandlePoke (std::string sPokeURL)
bool BuildSingleVariableWebPageContents (std::ostringstream &wp, MOOSMSG_LIST &MsgList)
bool BuildFullDBWebPageContents (std::ostringstream &wp, MOOSMSG_LIST &MsgList)
bool ReadRequest ()
bool ReadLine (std::string &)
void SendLine (std::string sLine)
void SendString (std::string sLine)

Protected Attributes

std::string m_sWebPage
CMOOSThread m_ServeThread
XPCTcpSocketm_pSocket
std::string m_sFocusVariable
HTTPRequest m_Request
CMOOSCommClientm_pMOOSComms
CMOOSLockm_pMOOSCommsLock

Detailed Description

Definition at line 19 of file HTTPConnection.h.


Constructor & Destructor Documentation

CHTTPConnection::CHTTPConnection ( XPCTcpSocket pNewSocket,
CMOOSCommClient pMOOSComms,
CMOOSLock pMOOSCommsLock 
)

simple constructor

Definition at line 94 of file HTTPConnection.cpp.


Member Function Documentation

static bool CHTTPConnection::_CB ( void *  pParam) [inline, static]

call back to allow Serve to run in MOOSThread

Definition at line 135 of file HTTPConnection.h.

bool CHTTPConnection::BuildFullDBWebPageContents ( std::ostringstream &  wp,
MOOSMSG_LIST MsgList 
) [protected]

build we page of whole DB

Definition at line 492 of file HTTPConnection.cpp.

bool CHTTPConnection::BuildSingleVariableWebPageContents ( std::ostringstream &  wp,
MOOSMSG_LIST MsgList 
) [protected]

Definition at line 430 of file HTTPConnection.cpp.

bool CHTTPConnection::HandlePoke ( std::string  sPokeURL) [protected]

respond to someone putting data

Definition at line 307 of file HTTPConnection.cpp.

bool CHTTPConnection::HasCompleted ( )

has the connection terminated?

Definition at line 605 of file HTTPConnection.cpp.

bool CHTTPConnection::MakeWebPage ( ) [protected]

Makes a webpage

Definition at line 357 of file HTTPConnection.cpp.

bool CHTTPConnection::ReadLine ( std::string &  sLine) [protected]

read a single line from client

Definition at line 235 of file HTTPConnection.cpp.

bool CHTTPConnection::ReadRequest ( ) [protected]

read a request header

Definition at line 158 of file HTTPConnection.cpp.

bool CHTTPConnection::Run ( )

start the connection processing...

Definition at line 102 of file HTTPConnection.cpp.

bool CHTTPConnection::SendFailureHeader ( ) [protected]

Sends a 404 error header

Definition at line 587 of file HTTPConnection.cpp.

bool CHTTPConnection::SendHeader ( ) [protected]

Sends an all OK header detailing length of page to follow

Definition at line 596 of file HTTPConnection.cpp.

void CHTTPConnection::SendLine ( std::string  sLine) [protected]

lower level send string with appended

Definition at line 220 of file HTTPConnection.cpp.

void CHTTPConnection::SendString ( std::string  sLine) [protected]

lower level send string (no line feed cr appended)

Definition at line 228 of file HTTPConnection.cpp.

bool CHTTPConnection::SendWebPage ( ) [protected]

Send the webpage itself

Definition at line 276 of file HTTPConnection.cpp.

bool CHTTPConnection::Serve ( ) [protected]

main sequence of response actions

Definition at line 112 of file HTTPConnection.cpp.


Member Data Documentation

pointer to a COmms Client (The DB Connection is shared between all HTTPConnections)

Definition at line 184 of file HTTPConnection.h.

pointer to a lock which provides protected access to the MOOS comms client object

Definition at line 187 of file HTTPConnection.h.

Socket which hold the Connection

Definition at line 175 of file HTTPConnection.h.

A HTTP Request instantiation

Definition at line 181 of file HTTPConnection.h.

Thread object which runs the servicing sequence of commands

Definition at line 173 of file HTTPConnection.h.

std::string CHTTPConnection::m_sFocusVariable [protected]

name of focus variable (empty for whole site request)

Definition at line 178 of file HTTPConnection.h.

std::string CHTTPConnection::m_sWebPage [protected]

string containing the webpage iteself

Definition at line 171 of file HTTPConnection.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines