OpenZWave Library  1.6.734
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
OpenZWave::SimpleHTTPClient::HttpSocket Class Reference

a Socket that speaks HTTP protocol.Talk to a HTTP(s) server More...

#include <HttpClient.h>

+ Inheritance diagram for OpenZWave::SimpleHTTPClient::HttpSocket:
+ Collaboration diagram for OpenZWave::SimpleHTTPClient::HttpSocket:

Public Member Functions

 HttpSocket ()
 
virtual ~HttpSocket ()
 
virtual bool HasPendingTask () const
 
void SetKeepAlive (unsigned int secs)
 
void SetUserAgent (const std::string &s)
 
void SetAcceptEncoding (const std::string &s)
 
void SetFollowRedirect (bool follow)
 
void SetAlwaysHandle (bool h)
 
void SetDownloadFile (std::string filename)
 
bool Download (const std::string &url, const char *extraRequest=NULL, void *user=NULL, const POST *post=NULL)
 
bool SendRequest (Request &what, bool enqueue)
 
bool SendRequest (const std::string what, const char *extraRequest=NULL, void *user=NULL)
 
bool QueueRequest (const std::string what, const char *extraRequest=NULL, void *user=NULL)
 
unsigned int GetRemaining () const
 
unsigned int GetStatusCode () const
 
unsigned int GetContentLen () const
 
bool ChunkedTransfer () const
 
bool ExpectMoreData () const
 
const RequestGetCurrentRequest () const
 
const char * Hdr (const char *h) const
 
bool IsRedirecting () const
 
bool IsSuccess () const
 
- Public Member Functions inherited from OpenZWave::SimpleHTTPClient::TcpSocket
 TcpSocket ()
 
virtual ~TcpSocket ()
 
bool open (const char *addr=NULL, unsigned int port=0)
 
void close ()
 
bool update ()
 
bool isOpen (void)
 
void SetBufsizeIn (unsigned int s)
 
bool SetNonBlocking (bool nonblock)
 
unsigned int GetBufSize ()
 
const char * GetHost (void)
 
bool SendBytes (const void *buf, unsigned int len)
 
bool initSSL (const char *certs)
 
bool hasSSL () const
 
void shutdownSSL ()
 
SSLResult verifySSL ()
 

Protected Member Functions

virtual void _OnCloseInternal ()
 
virtual void _OnClose ()
 
virtual void _OnData ()
 
virtual void _OnRecv (void *buf, unsigned int size)
 
virtual void _OnOpen ()
 
virtual bool _OnUpdate ()
 
virtual void _OnRequestDone ()
 
bool _Redirect (std::string loc, bool forceGET)
 
void _ProcessChunk ()
 
bool _EnqueueOrSend (const Request &req, bool forceQueue=false)
 
void _DequeueMore ()
 
bool _OpenRequest (const Request &req)
 
void _ParseHeader ()
 
void _ParseHeaderFields (const char *s, size_t size)
 
bool _HandleStatus ()
 
void _FinishRequest ()
 
void _OnRecvInternal (void *buf, unsigned int size)
 
- Protected Member Functions inherited from OpenZWave::SimpleHTTPClient::TcpSocket
void _ShiftBuffer ()
 

Protected Attributes

std::string _user_agent
 
std::string _accept_encoding
 
std::string _tmpHdr
 
unsigned int _keep_alive
 
unsigned int _remaining
 
unsigned int _contentLen
 
unsigned int _status
 
std::queue< Request_requestQ
 
std::map< std::string, std::string > _hdrs
 
Request _curRequest
 
bool _inProgress
 
bool _chunkedTransfer
 
bool _mustClose
 
bool _followRedir
 
bool _alwaysHandle
 
std::string _filename
 
FILE * _pFile
 
- Protected Attributes inherited from OpenZWave::SimpleHTTPClient::TcpSocket
char * _inbuf
 
char * _readptr
 
char * _writeptr
 
unsigned int _inbufSize
 
unsigned int _writeSize
 
unsigned int _recvSize
 
unsigned int _lastport
 
bool _nonblocking
 
long _s
 
std::string _host
 

Detailed Description

a Socket that speaks HTTP protocol.

Talk to a HTTP(s) server

Constructor & Destructor Documentation

◆ HttpSocket()

OpenZWave::SimpleHTTPClient::HttpSocket::HttpSocket ( )

◆ ~HttpSocket()

virtual OpenZWave::SimpleHTTPClient::HttpSocket::~HttpSocket ( )
virtual

Member Function Documentation

◆ _DequeueMore()

void OpenZWave::SimpleHTTPClient::HttpSocket::_DequeueMore ( )
protected

◆ _EnqueueOrSend()

bool OpenZWave::SimpleHTTPClient::HttpSocket::_EnqueueOrSend ( const Request req,
bool  forceQueue = false 
)
protected

◆ _FinishRequest()

void OpenZWave::SimpleHTTPClient::HttpSocket::_FinishRequest ( )
protected

◆ _HandleStatus()

bool OpenZWave::SimpleHTTPClient::HttpSocket::_HandleStatus ( )
protected

◆ _OnClose()

virtual void OpenZWave::SimpleHTTPClient::HttpSocket::_OnClose ( )
protectedvirtual

◆ _OnCloseInternal()

virtual void OpenZWave::SimpleHTTPClient::HttpSocket::_OnCloseInternal ( )
protectedvirtual

◆ _OnData()

virtual void OpenZWave::SimpleHTTPClient::HttpSocket::_OnData ( )
protectedvirtual

◆ _OnOpen()

virtual void OpenZWave::SimpleHTTPClient::HttpSocket::_OnOpen ( )
protectedvirtual

◆ _OnRecv()

virtual void OpenZWave::SimpleHTTPClient::HttpSocket::_OnRecv ( void *  buf,
unsigned int  size 
)
protectedvirtual

◆ _OnRecvInternal()

void OpenZWave::SimpleHTTPClient::HttpSocket::_OnRecvInternal ( void *  buf,
unsigned int  size 
)
protected

◆ _OnRequestDone()

virtual void OpenZWave::SimpleHTTPClient::HttpSocket::_OnRequestDone ( )
inlineprotectedvirtual

◆ _OnUpdate()

virtual bool OpenZWave::SimpleHTTPClient::HttpSocket::_OnUpdate ( )
protectedvirtual

◆ _OpenRequest()

bool OpenZWave::SimpleHTTPClient::HttpSocket::_OpenRequest ( const Request req)
protected

◆ _ParseHeader()

void OpenZWave::SimpleHTTPClient::HttpSocket::_ParseHeader ( )
protected

◆ _ParseHeaderFields()

void OpenZWave::SimpleHTTPClient::HttpSocket::_ParseHeaderFields ( const char *  s,
size_t  size 
)
protected

◆ _ProcessChunk()

void OpenZWave::SimpleHTTPClient::HttpSocket::_ProcessChunk ( )
protected

◆ _Redirect()

bool OpenZWave::SimpleHTTPClient::HttpSocket::_Redirect ( std::string  loc,
bool  forceGET 
)
protected

◆ ChunkedTransfer()

bool OpenZWave::SimpleHTTPClient::HttpSocket::ChunkedTransfer ( ) const
inline

◆ Download()

bool OpenZWave::SimpleHTTPClient::HttpSocket::Download ( const std::string &  url,
const char *  extraRequest = NULL,
void *  user = NULL,
const POST post = NULL 
)

◆ ExpectMoreData()

bool OpenZWave::SimpleHTTPClient::HttpSocket::ExpectMoreData ( ) const
inline

◆ GetContentLen()

unsigned int OpenZWave::SimpleHTTPClient::HttpSocket::GetContentLen ( ) const
inline

◆ GetCurrentRequest()

const Request& OpenZWave::SimpleHTTPClient::HttpSocket::GetCurrentRequest ( ) const
inline

◆ GetRemaining()

unsigned int OpenZWave::SimpleHTTPClient::HttpSocket::GetRemaining ( ) const
inline

◆ GetStatusCode()

unsigned int OpenZWave::SimpleHTTPClient::HttpSocket::GetStatusCode ( ) const
inline

◆ HasPendingTask()

virtual bool OpenZWave::SimpleHTTPClient::HttpSocket::HasPendingTask ( ) const
inlinevirtual

◆ Hdr()

const char* OpenZWave::SimpleHTTPClient::HttpSocket::Hdr ( const char *  h) const

◆ IsRedirecting()

bool OpenZWave::SimpleHTTPClient::HttpSocket::IsRedirecting ( ) const

◆ IsSuccess()

bool OpenZWave::SimpleHTTPClient::HttpSocket::IsSuccess ( ) const

◆ QueueRequest()

bool OpenZWave::SimpleHTTPClient::HttpSocket::QueueRequest ( const std::string  what,
const char *  extraRequest = NULL,
void *  user = NULL 
)

◆ SendRequest() [1/2]

bool OpenZWave::SimpleHTTPClient::HttpSocket::SendRequest ( Request what,
bool  enqueue 
)

◆ SendRequest() [2/2]

bool OpenZWave::SimpleHTTPClient::HttpSocket::SendRequest ( const std::string  what,
const char *  extraRequest = NULL,
void *  user = NULL 
)

◆ SetAcceptEncoding()

void OpenZWave::SimpleHTTPClient::HttpSocket::SetAcceptEncoding ( const std::string &  s)
inline

◆ SetAlwaysHandle()

void OpenZWave::SimpleHTTPClient::HttpSocket::SetAlwaysHandle ( bool  h)
inline

◆ SetDownloadFile()

void OpenZWave::SimpleHTTPClient::HttpSocket::SetDownloadFile ( std::string  filename)
inline

◆ SetFollowRedirect()

void OpenZWave::SimpleHTTPClient::HttpSocket::SetFollowRedirect ( bool  follow)
inline

◆ SetKeepAlive()

void OpenZWave::SimpleHTTPClient::HttpSocket::SetKeepAlive ( unsigned int  secs)
inline

◆ SetUserAgent()

void OpenZWave::SimpleHTTPClient::HttpSocket::SetUserAgent ( const std::string &  s)
inline

Member Data Documentation

◆ _accept_encoding

std::string OpenZWave::SimpleHTTPClient::HttpSocket::_accept_encoding
protected

◆ _alwaysHandle

bool OpenZWave::SimpleHTTPClient::HttpSocket::_alwaysHandle
protected

◆ _chunkedTransfer

bool OpenZWave::SimpleHTTPClient::HttpSocket::_chunkedTransfer
protected

◆ _contentLen

unsigned int OpenZWave::SimpleHTTPClient::HttpSocket::_contentLen
protected

◆ _curRequest

Request OpenZWave::SimpleHTTPClient::HttpSocket::_curRequest
protected

◆ _filename

std::string OpenZWave::SimpleHTTPClient::HttpSocket::_filename
protected

◆ _followRedir

bool OpenZWave::SimpleHTTPClient::HttpSocket::_followRedir
protected

◆ _hdrs

std::map<std::string, std::string> OpenZWave::SimpleHTTPClient::HttpSocket::_hdrs
protected

◆ _inProgress

bool OpenZWave::SimpleHTTPClient::HttpSocket::_inProgress
protected

◆ _keep_alive

unsigned int OpenZWave::SimpleHTTPClient::HttpSocket::_keep_alive
protected

◆ _mustClose

bool OpenZWave::SimpleHTTPClient::HttpSocket::_mustClose
protected

◆ _pFile

FILE* OpenZWave::SimpleHTTPClient::HttpSocket::_pFile
protected

◆ _remaining

unsigned int OpenZWave::SimpleHTTPClient::HttpSocket::_remaining
protected

◆ _requestQ

std::queue<Request> OpenZWave::SimpleHTTPClient::HttpSocket::_requestQ
protected

◆ _status

unsigned int OpenZWave::SimpleHTTPClient::HttpSocket::_status
protected

◆ _tmpHdr

std::string OpenZWave::SimpleHTTPClient::HttpSocket::_tmpHdr
protected

◆ _user_agent

std::string OpenZWave::SimpleHTTPClient::HttpSocket::_user_agent
protected

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