Main Page   Class Hierarchy   Compound List   File List   Compound Members  

CAVERNnet_rpcCaller_c Class Reference

#include <CAVERNnet_rpc_c.hxx>

List of all members.

Public Methods

int init (char *remoteProcedureName, char *ipAddress, int destPort=CAVERNnet_rpcManager_c::DEFAULT_PORT)
int call (char *outdata, int outlen, char **retdata, int *retlen)
int call1way (char *outdata, int outlen)
void setTimeOut (int timeout=CAVERNnet_rpcCaller_c::NEVER_TIME_OUT)
 CAVERNnet_rpcCaller_c ()
void showStats (char *streamInfo, char *comment)
int logStats (char *streamInfo, char *comment, FILE *filePtr)
int sendStats (char *streamInfo, char *comment)
int initSendStats (char *monitorClientIP, int port=PERF_DAEMON_DEFAULT_PORT)
void exitSendStats ()

Static Public Attributes

const int NEVER_TIME_OUT
 Use to set RPCs to never time out.

const int FAILED
 RPC Failed.

const int OK
 RPC Ok.

const int MEM_ALLOC_ERR
 Mem alloc error in RPC.


Private Attributes

char* rpcName
char ipAddress [256]
int destinationPort
int itsTimeOut
CAVERNnet_perfMonitor_c pmonitor


Detailed Description

Remote Procedure Caller class. Use this to call the remote RPC manager.


Member Function Documentation

int CAVERNnet_rpcCaller_c::call ( char * outdata,
int outlen,
char ** retdata,
int * retlen )
 

Remote procedure call.

Parameters:
outdata   outgoing data
outlen   outgoing data size
retdata   incoming return data
retlen   incoming return data size
Returns:
OK or MEM_ALLOC_ERR or FAILED

int CAVERNnet_rpcCaller_c::call1way ( char * outdata,
int outlen )
 

1 way RPC. Ie a remote call without a reply.

Parameters:
outdata   outgoing data
outlen   outgoing data size
Returns:
OK or FAILED

void CAVERNnet_rpcCaller_c::exitSendStats ( )
 

Properly delete the perfDaemonClient after sendStats is done

int CAVERNnet_rpcCaller_c::init ( char * remoteProcedureName,
char * ipAddress,
int destPort = CAVERNnet_rpcManager_c::DEFAULT_PORT )
 

Initialize RPC.

Parameters:
remoteProcedureName   name of remote procedure
ipAddress   ip address of rpc server.
destPort   destination port of rpc server.
Returns:
OK or MEM_ALLOC_ERR

int CAVERNnet_rpcCaller_c::initSendStats ( char * monitorClientIP,
int port = PERF_DAEMON_DEFAULT_PORT )
 

Initialize sendStats - provide the IP of the perfDaemon and an optional port number to connect to. This should be done initially before using the sendStats API.

Parameters:
monitorClientIP   IP address of the perfDameon to connect to
port   Port number at which the perfDaemon is running -this is optional. The default port number for perfDaemon is 9500 -so a different port number has to be specified if the perfDaemon is running ona different port.

Returns:
Either CAVERNnet_perfMonitor_c::OK or CAVERNnet_perfMonitor_c::FAILED

int CAVERNnet_rpcCaller_c::logStats ( char * streamInfo,
char * comment,
FILE * filePtr )
 

This logs performance statistics in a file. The user opens a file and passes the file pointer with this function and results of monitoring are written into the logfile.

Parameters:
streamInfo   A label describing the stream that is being monitored.
comment   A comment on the event that marks the time at which the stream is being monitored
filePtr   File pointer to the file in which the results of monitoring are to be stored

Returns:
Either CAVERNnet_perfMonitor_c::OK or CAVERNnet_perfMonitor_c::FAILED

int CAVERNnet_rpcCaller_c::sendStats ( char * streamInfo,
char * comment )
 

Sends the performance statistics to a remote perfdaemon -for further analysis of the monitored data - the initSendStats API should be called first, before calling a sendStats (In order to connect to the perfdaemon initially)

Parameters:
streamInfo   A label describing the stream that is being monitored.
comment   A comment on the event that marks the time at which the stream is being monitored

Returns:
Either CAVERNnet_perfMonitor_c::OK or CAVERNnet_perfMonitor_c::FAILED

void CAVERNnet_rpcCaller_c::setTimeOut ( int timeout = CAVERNnet_rpcCaller_c::NEVER_TIME_OUT ) [inline]
 

Set the timeout time waiting for a reply from an RPC.

Parameters:
timeout   is either CAVERNnet_rpcClient_c::NEVER_TIME_OUT or time in seconds.

void CAVERNnet_rpcCaller_c::showStats ( char * streamInfo,
char * comment )
 

Displays the resultant statistics instantaneously in the netlogger format - this should be typically done after a read/write is done a network.

Also, it should be noted that a showStats call should be made at the end of atleast one send and receive for two-way information (the same applies for logStats and sendStats)

Parameters:
streamInfo   A label describing the stream that is being monitored.
comment   A comment on the event that marks the time at which the stream is being monitored


The documentation for this class was generated from the following file:
Generated at Mon Jul 2 14:24:44 2001 for CAVERNsoft by doxygen1.2.8-20010617 written by Dimitri van Heesch, © 1997-2001