client Class Referenceabstract

Inherits filedescriptor.

Inherited by modemclient, and socketclient.

## Public Member Functions

| client ()
| client (const client &c)
client & | operator= (const client &c)
virtual | ~client ()
virtual void | initialize (constnamevaluepairs *cd)=0
virtual int32_t | connect ()=0
virtual const char * | getVerboseConnectError ()
virtual void | setVerboseConnectError (const char *error)
Public Member Functions inherited from filedescriptor
| filedescriptor ()
| filedescriptor (const filedescriptor &f)
filedescriptor & | operator= (const filedescriptor &f)
virtual | ~filedescriptor ()
virtual bool | close ()
int32_t | getFileDescriptor () const
void | setFileDescriptor (int32_t filedesc)
int32_t | duplicate () const
bool | duplicate (int32_t newfd) const
virtual bool | supportsBlockingNonBlockingModes ()
virtual bool | useNonBlockingMode () const
virtual bool | useBlockingMode () const
virtual bool | isUsingNonBlockingMode () const
ssize_t | write (uint16_t number) const
ssize_t | write (uint32_t number) const
ssize_t | write (uint64_t number) const
ssize_t | write (int16_t number) const
ssize_t | write (int32_t number) const
ssize_t | write (int64_t number) const
ssize_t | write (float number) const
ssize_t | write (double number) const
ssize_t | write (unsigned char character) const
ssize_t | write (char character) const
ssize_t | write (bool value) const
ssize_t | write (const unsigned char *string) const
ssize_t | write (const char *string) const
ssize_t | write (const unsigned char *string, size_t size) const
ssize_t | write (const char *string, size_t size) const
ssize_t | write (const void *buffer, size_t size) const
ssize_t | write (uint16_t number, int32_t sec, int32_t usec) const
ssize_t | write (uint32_t number, int32_t sec, int32_t usec) const
ssize_t | write (uint64_t number, int32_t sec, int32_t usec) const
ssize_t | write (int16_t number, int32_t sec, int32_t usec) const
ssize_t | write (int32_t number, int32_t sec, int32_t usec) const
ssize_t | write (int64_t number, int32_t sec, int32_t usec) const
ssize_t | write (float number, int32_t sec, int32_t usec) const
ssize_t | write (double number, int32_t sec, int32_t usec) const
ssize_t | write (unsigned char character, int32_t sec, int32_t usec) const
ssize_t | write (char character, int32_t sec, int32_t usec) const
ssize_t | write (bool value, int32_t sec, int32_t usec) const
ssize_t | write (const unsigned char *string, int32_t sec, int32_t usec) const
ssize_t | write (const char *string, int32_t sec, int32_t usec) const
ssize_t | write (const unsigned char *string, size_t size, int32_t sec, int32_t usec) const
ssize_t | write (const char *string, size_t size, int32_t sec, int32_t usec) const
ssize_t | write (const void *buffer, size_t size, int32_t sec, int32_t usec) const
size_t | printf (const char *format,...)
size_t | printf (const char *format, va_list *argp)
void | safePrint (char c)
void | safePrint (const char *str)
void | safePrint (const char *str, int32_t length)
void | printBits (unsigned char value)
void | printBits (uint16_t value)
void | printBits (uint32_t value)
void | printBits (uint64_t value)
void | printBits (char value)
void | printBits (int16_t value)
void | printBits (int32_t value)
void | printBits (int64_t value)
void | printBits (unsigned char *bits, uint64_t size)
ssize_t | read (uint16_t *buffer) const
ssize_t | read (uint32_t *buffer) const
ssize_t | read (uint64_t *buffer) const
ssize_t | read (int16_t *buffer) const
ssize_t | read (int32_t *buffer) const
ssize_t | read (int64_t *buffer) const
ssize_t | read (float *buffer) const
ssize_t | read (double *buffer) const
ssize_t | read (unsigned char *buffer) const
ssize_t | read (char *buffer) const
ssize_t | read (bool *buffer) const
ssize_t | read (unsigned char *buffer, size_t size) const
ssize_t | read (char *buffer, size_t size) const
ssize_t | read (void *buf, size_t size) const
ssize_t | read (char **buffer, const char *terminator) const
ssize_t | read (uint16_t *buffer, int32_t sec, int32_t usec) const
ssize_t | read (uint32_t *buffer, int32_t sec, int32_t usec) const
ssize_t | read (uint64_t *buffer, int32_t sec, int32_t usec) const
ssize_t | read (int16_t *buffer, int32_t sec, int32_t usec) const
ssize_t | read (int32_t *buffer, int32_t sec, int32_t usec) const
ssize_t | read (int64_t *buffer, int32_t sec, int32_t usec) const
ssize_t | read (float *buffer, int32_t sec, int32_t usec) const
ssize_t | read (double *buffer, int32_t sec, int32_t usec) const
ssize_t | read (unsigned char *buffer, int32_t sec, int32_t usec) const
ssize_t | read (char *buffer, int32_t sec, int32_t usec) const
ssize_t | read (bool *buffer, int32_t sec, int32_t usec) const
ssize_t | read (unsigned char *buffer, size_t size, int32_t sec, int32_t usec) const
ssize_t | read (char *buffer, size_t size, int32_t sec, int32_t usec) const
ssize_t | read (void *buf, size_t size, int32_t sec, int32_t usec) const
ssize_t | read (char **buffer, const char *terminator, int32_t sec, int32_t usec) const
int32_t | waitForNonBlockingRead (int32_t sec, int32_t usec) const
int32_t | waitForNonBlockingWrite (int32_t sec, int32_t usec) const
void | retryInterruptedReads ()
void | dontRetryInterruptedReads ()
bool | getRetryInterruptedReads () const
void | retryInterruptedWrites ()
void | dontRetryInterruptedWrites ()
bool | getRetryInterruptedWrites () const
void | retryInterruptedWaits ()
void | dontRetryInterruptedWaits ()
bool | getRetryInterruptedWaits () const
void | retryInterruptedFcntl ()
void | dontRetryInterruptedFcntl ()
bool | getRetryInterruptedFcntl () const
void | retryInterruptedIoctl ()
void | dontRetryInterruptedIoctl ()
bool | getRetryInterruptedIoctl () const
void | allowShortReads ()
void | dontAllowShortReads ()
void | allowShortWrites ()
void | dontAllowShortWrites ()
void | useListener (listener *lstnr)
void | dontUseListener ()
listener * | getListener ()
void | useListenerInsideReads ()
void | dontUseListenerInsideReads ()
void | useListenerInsideWrites ()
void | dontUseListenerInsideWrites ()
virtual bool | passFileDescriptor (int32_t fd) const
virtual bool | receiveFileDescriptor (int32_t *fd) const
virtual bool | passSocket (int32_t sock) const
virtual bool | receiveSocket (int32_t *sock) const
void | translateByteOrder ()
void | dontTranslateByteOrder ()
virtual int32_t | fCntl (int32_t command, long arg) const
virtual int32_t | ioCtl (int32_t command, void *arg) const
bool | useNaglesAlgorithm ()
bool | dontUseNaglesAlgorithm ()
bool | setTcpWriteBufferSize (int32_t size)
bool | getTcpWriteBufferSize (int32_t *size)
bool | setTcpReadBufferSize (int32_t size)
bool | getTcpReadBufferSize (int32_t *size)
bool | disableIPv4 ()
bool | enableIPv4 ()
const char * | getType () const
char * | getPeerAddress () const
bool | setWriteBufferSize (ssize_t size) const
bool | flushWriteBuffer (int32_t sec, int32_t usec) const
bool | setReadBufferSize (ssize_t size) const
bool | closeOnExec ()
bool | dontCloseOnExec ()
bool | getCloseOnExec ()

## Additional Inherited Members

Static Public Member Functions inherited from filedescriptor
static uint16_t | hostToNet (uint16_t value)
static uint32_t | hostToNet (uint32_t value)
static uint64_t | hostToNet (uint64_t value)
static uint16_t | netToHost (uint16_t value)
static uint32_t | netToHost (uint32_t value)
static uint64_t | netToHost (uint64_t value)

## Detailed Description

The client class provides a base class for classes that implement the client side of a client-server communication model.

## Constructor & Destructor Documentation

client::client | ( |  | ) |

Creates an instance of the client class.

client::client | ( | const client & | c | ) |

Creates an instance of the client class that is a copy of "c".

virtual client::~client | ( |  | ) |

virtual

Deletes this instance of the client class.

## Member Function Documentation

virtual int32_t client::connect | ( |  | ) |

pure virtual

This method must be implemnted by a child class to open a connection to a server, presumably specified in the "cd" parameter of the initalize() method.

This method return an int32_t instead of a bool so child classes that have non atomic connection procedures (such as a modem) can implement return codes other than success or failure (such as abort).

Implemented in inetsocketclient, unixsocketclient, and modemclient.

virtual const char* client::getVerboseConnectError | ( |  | ) |

virtual

This method returns NULL by default but may be implemented by a child class to return a detailed reason for a connect failure.

virtual void client::initialize | ( | constnamevaluepairs * | cd | ) |

pure virtual

This method must be implemented by a child class to initialize this instance with the parameters defined in "cd".

Implemented in unixsocketclient, inetsocketclient, and modemclient.

client& client::operator= | ( | const client & | c | ) |

Makes this instance of the client class identical to "c".

virtual void client::setVerboseConnectError | ( | const char * | error | ) |

virtual

This method may be used to set the verbose connect error.