Rudiments
Public Member Functions
modemclient Class Reference

Inherits client, and modemutil.

List of all members.

Public Member Functions

 modemclient ()
 modemclient (const modemclient &m)
modemclientoperator= (const modemclient &m)
virtual ~modemclient ()
void initialize (constnamevaluepairs *cd)
void initialize (const char *device, const char *baud, const char *customatcommands, const char *connectscript, const char *phonenumber, const char *disconnectscript, unsigned long retrywait, unsigned long retrycount)
int32_t connect ()
bool close ()

Detailed Description

The modemclient implements methods for connecting to and communicating with a remote host using a modem.


Constructor & Destructor Documentation

modemclient::modemclient ( )

Creates an instance of the modemclient class.

modemclient::modemclient ( const modemclient m)

Creates an instance of the modemclient class that is a copy of "m".

virtual modemclient::~modemclient ( ) [virtual]

Deletes this instance of the modemclient class.


Member Function Documentation

bool modemclient::close ( ) [virtual]

Hangs up the modem and closes the device.

Returns true on success and false on failure.

Reimplemented from filedescriptor.

int32_t modemclient::connect ( ) [virtual]

Dials the modem and attempt to establish a connection. If the connection fails, it will retry "retrycount" times, waiting "retrywait" seconds between retrycount.

Setting "retrycount" to 0 will cause it to try to connect indefinitely. Setting "retrywait" to 0 will cause it to try to connect over and over as fast as possible (not recommended).

Each attempt to connect will wait "timeoutsec" seconds and "timeoutusec" microseconds for the connect to succeed. Specifying -1 for either parameter will cause the attempt to wait until the underlying protocol times out which may be up to 2 minutes.

Returns RESULT_SUCCESS on success and RESULT_ERROR on failure.

Implements client.

void modemclient::initialize ( constnamevaluepairs cd) [virtual]

Initializes the class to use "device", "baud, "connectscript", "phonenumber", "disconnectscript", "retrywait" and "retrycount" when connect() is called.

Implements client.

void modemclient::initialize ( const char *  device,
const char *  baud,
const char *  customatcommands,
const char *  connectscript,
const char *  phonenumber,
const char *  disconnectscript,
unsigned long  retrywait,
unsigned long  retrycount 
)

Initializes the class to use "device", "baud, "customatcommands", "connectscript", "phonenumber", "disconnectscript", "retrywait" and "retrycount" when connect() is called.

modemclient& modemclient::operator= ( const modemclient m)

Makes this instance of the modemclient class identical to "m".