In file AppClient/AppClient.hh:

class AppClient

Application client API.

Inheritance:


Public Methods

virtual ~AppClient (void)
Destructor.
AppClient (void)
Default constructor.
error_type request (const MsgAddr& to, const Message& req, MsgHeader& hdr, char* data, index_type length)
Send a request message to a server and wait for the reply.
error_type request (const MsgHeader& ReqHdr, const void* ReqData, MsgHeader& hdr, char* data, index_type length)
Send a request message to a server and wait for the reply.
error_type request (const MsgAddr& to, const Message& Req, Message& Reply)
Send a request message to a server and wait for the reply.
error_type request (const MsgAddr& to, const Message& Req, MsgHeader& RepHdr, Message& Reply)
Send a request message to a server and wait for the reply.
error_type getDebug (void) const
Get the debug flag.
error_type getRetry (void) const
Get number of retries.
wtime_type getTimeOut (void) const
Maximum response time.
bool isOpen (void) const
Test whether Client is open.
void setBufferPool (BufferPool* pool)
Select a buffer pool.
void setDebug (index_type level)
Set the debug flag.
void setRetry (index_type n)
Set the maximum number of retries..
void setTimeOut (wtime_type time)
Set the maximum response time.
void setSocketPool (SocketPool* pool)
Select a socket pool.

Documentation

The client application class provides a generic client API. AppClient provides the primitive client request operation and server name resolution functions. If a server does not reply to a request within a specified amount of time, the request is retried. A transaction ID is sent with the request and returned with the reply. The client API verifies that the trasaction ID of the reply is correct. The port used by the client API is allocated dynamically from a specified socket pool or from the defaul pool. If a request fails. the socket is deleted and a new socket is allocated to retry the request. In non-linux systems, the socket is logically connected to the server socket before the request is made. This allows the client to receive notification if the server socket is not available.
virtual ~AppClient(void)
Client destructor.

AppClient(void)
Construct a disconnected client interface.

error_type request(const MsgAddr& to, const Message& req, MsgHeader& hdr, char* data, index_type length)
Send a request message to the specified server and wait for a reply. If no reply is received in the specified timeout period, the request is resent. The reply header and message are stored in the buffers provided by the user.
Returns:
Error code from lmsg::ErrorList.
Parameters:
to - Address of server to handle request.
req - Request message.
hdr - Reply header.
data - Pointer to buffer to receive reply text.
length - Length of reply buffer.

error_type request(const MsgHeader& ReqHdr, const void* ReqData, MsgHeader& hdr, char* data, index_type length)
Send a request message to the specified server and wait for a reply. If no reply is received in the specified timeout period, the request is resent. The reply header and message are stored in the buffers provided by the user.
Returns:
Error code from lmsg::ErrorList.
Parameters:
ReqHdr - Request header (with destination, type, length).
ReqData - Request message text.
hdr - Reply header.
data - Pointer to buffer to receive reply text.
length - Length of reply buffer.

error_type request(const MsgAddr& to, const Message& Req, Message& Reply)
Send a request message to the specified server and wait for a reply. If no reply is received in the specified timeout period, the request is resent. The reply header and message are stored in the buffers provided by the user.
Returns:
Error code from lmsg::ErrorList.
Parameters:
to - Request header (including det, type, length).
Req - Request message.
Reply - Reply message.

error_type request(const MsgAddr& to, const Message& Req, MsgHeader& RepHdr, Message& Reply)
Send a request message to the specified server and wait for a reply. If no reply is received in the specified timeout period, the request is resent. The reply header and message are stored in the buffers provided by the user.
Returns:
Error code from lmsg::ErrorList.
Parameters:
to - Request header (including det, type, length).
Req - Request message.
RepHdr - Reply message header.
Reply - Reply message.

error_type getDebug(void) const
Get the Debug flag contents.
Returns:
The debug flag contents.

error_type getRetry(void) const
Get the maximum number of retries.
Returns:
The maximum number of retries.

wtime_type getTimeOut(void) const
Get the maximum response time.
Returns:
Maximum reply time.

bool isOpen(void) const
Test whether the client interface is open.
Returns:
true if client interface is ready for work.

void setBufferPool(BufferPool* pool)
Specify the buffer pool to be used by this client.
Parameters:
pool - Pointer to the buffer pool to be used.

void setDebug(index_type level)
Set the Debug flag contents. If the debug flag is non-zero status messages will be printed each time a request is made.
Parameters:
level - New debug flag contents.

void setRetry(index_type n)
Specify the maximum number of times a request is to be retried by this client if no valid reply is received.
Parameters:
n - Maximum number of retries.

void setTimeOut(wtime_type time)
Specify the maximum wait time before retrying a request.
Parameters:
time - Wait time.

void setSocketPool(SocketPool* pool)
Specify the socket pool to be used by this client.
Parameters:
pool - Pointer to the socket pool to be used by this client.


This class has no child classes.
Author:
John Zweizig
Version:
1.2; Modified May 12, 2000

alphabetic index hierarchy of classes


Please send questions and comments to zweizig_j@ligo.caltech.edu


generated by doc++