GClasses
GClasses::GDomClient Class Reference

Detailed Description

This is a socket client that sends and receives DOM nodes.

#include <GSocket.h>

Inheritance diagram for GClasses::GDomClient:
GClasses::GPackageClient

Public Member Functions

 GDomClient ()
 
virtual ~GDomClient ()
 
const GDomNodereceive ()
 Receive the next available DOM node, or NULL if none are ready. More...
 
void send (GDomNode *pNode)
 Send the specified DOM node. More...
 
- Public Member Functions inherited from GClasses::GPackageClient
 GPackageClient ()
 
virtual ~GPackageClient ()
 
void connect (const char *addr, unsigned short port, int timeoutSecs=20)
 Connect to a server. Throws an exception if it fails to connect within the specified timout period. More...
 
void disconnect ()
 Disconnect from the server. More...
 
virtual void pump ()
 Receives any pending messages into an internal buffer (to unblock the server, in case its send buffer is full.) More...
 
char * receive (size_t *pLen)
 Receive the next available package. (This returns a pointer to an internal buffer, the contents of which only remain valid until the next time you call receive.) More...
 
void send (const char *buf, size_t len)
 Send a package, which guarantees to arrive in the same order and size as it was sent. More...
 
void setMaxBufferSizes (size_t a, size_t b)
 Sets some internal values that guide how it reallocates the internal buffer. 'a' is the maximum buffer size to keep around. 'b' is the maximum size for the buffer ever. If a package bigger than 'b' is sent, an exception will be thrown. If a package bigger than 'a' is sent, then the buffer will be grown to that size, but it will be made small again the next time a package is received. More...
 

Protected Attributes

GDom m_doc
 
- Protected Attributes inherited from GClasses::GPackageClient
GPackageConnection m_conn
 
unsigned int m_maxBufSize
 
unsigned int m_maxPackageSize
 

Additional Inherited Members

- Protected Member Functions inherited from GClasses::GPackageClient
virtual void onDisconnect ()
 This is called when the connection is first known to have disconnected. More...
 
virtual void onReceiveBadData (const char *message)
 This method is called if the peer sends data that does not follow the expected protocol. More...
 

Constructor & Destructor Documentation

GClasses::GDomClient::GDomClient ( )
inline
virtual GClasses::GDomClient::~GDomClient ( )
inlinevirtual

Member Function Documentation

const GDomNode* GClasses::GDomClient::receive ( )

Receive the next available DOM node, or NULL if none are ready.

void GClasses::GDomClient::send ( GDomNode pNode)

Send the specified DOM node.

Member Data Documentation

GDom GClasses::GDomClient::m_doc
protected