Main Page   Class Hierarchy   Compound List   File List   Compound Members  

CAVERNnet_remoteFileIOClient32_c Class Reference

#include <CAVERNnet_remoteFileIO32_c.hxx>

List of all members.

Public Methods

 CAVERNnet_remoteFileIOClient32_c ()
void setRemotePort (int port=CAVERNnet_remoteFileIOServer32_c::DEFAULT_PORT)
 Set port number to connect to.

int upload (char *ipAddress, char *localFileName, char *remoteFileName)
int download (char *ipAddress, char *localFilename, char *remoteFileName)
int getRemoteDateTime (char *ipAddress, char *remoteFileName, int *remDay, int *remMon, int *remYear, int *remHour, int *remMin, int *remSec)
int compareDateTime (int day1, int month1, int year1, int hour1, int minute1, int second1, int day2, int month2, int year2, int hour2, int minute2, int second2)
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 Methods

int getLocalDateTime (char *filename, int *day, int *month, int *year, int *hour, int *minute, int *second)

Static Public Attributes

const int OK
 Status ok.

const int FAILED
 Status failed.

const int CANNOT_CONNECT
 Cannot connect to remote server.

const int CANNOT_READ_LOCAL_FILE
 Cannot open local file for reading.

const int CANNOT_WRITE_LOCAL_FILE
 CAnnot write to local file.

const int INVALID_COMMAND
 Received invalid command from server.

const int MEM_ALLOC_ERR
 Memory allocation error.

const int FILE_ERROR
 Remote file error.

const int EARLIER
 Earlier date/time.

const int LATER
 Later date/time.

const int SAME
 Same date/time.


Private Attributes

int remotePort
CAVERNnet_extendedTcpClient_c client
CAVERNnet_perfMonitor_c pmonitor


Detailed Description

Upload and download files to and from a remote server. This client is designed specifically to connect to CAVERNnet_remoteFileIOServer32_c.


Member Function Documentation

int CAVERNnet_remoteFileIOClient32_c::compareDateTime ( int day1,
int month1,
int year1,
int hour1,
int minute1,
int second1,
int day2,
int month2,
int year2,
int hour2,
int minute2,
int second2 )
 

Compare time/date1 with time/date2.

Returns:
EARLIER - if time/date1 is earlier than time/date2 LATER - if time/date1 is later than time/date2 SAME - if time/date1 and 2 are same.

int CAVERNnet_remoteFileIOClient32_c::download ( char * ipAddress,
char * localFilename,
char * remoteFileName )
 

Download a file from the remote server. If the remote file is not found or a network error occurs, this function will return with a failed.

Parameters:
ipAddress   is IP address of remote server.
localFileName   is local file write to.
remoteFileName   is remote file to get.
Returns:
OK, FAILED, CANNOT_WRITE_LOCAL_FILE, INVALID_COMMAND, CANNOT_CONNECT

void CAVERNnet_remoteFileIOClient32_c::exitSendStats ( )
 

Properly delete the perfDaemonClient after sendStats is done

int CAVERNnet_remoteFileIOClient32_c::getLocalDateTime ( char * filename,
int * day,
int * month,
int * year,
int * hour,
int * minute,
int * second ) [static]
 

Retrieve a local file's date and time stamp. Date/Time is in GMT.

Returns:
OK or FILE_ERROR - if local file could not be accessed. Values of day, month, year, etc will return all -1s if FILE_ERROR occurs.

int CAVERNnet_remoteFileIOClient32_c::getRemoteDateTime ( char * ipAddress,
char * remoteFileName,
int * remDay,
int * remMon,
int * remYear,
int * remHour,
int * remMin,
int * remSec )
 

Retrieve a remote file's date and time stamp. Date/Time is in GMT.

Returns:
OK, FAILED - if command failed; FILE_ERROR - if remote file cannot be accessed. Values of day, month, year, etc will return all -1s if FILE_ERROR occurs.

int CAVERNnet_remoteFileIOClient32_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_remoteFileIOClient32_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_remoteFileIOClient32_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_remoteFileIOClient32_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

int CAVERNnet_remoteFileIOClient32_c::upload ( char * ipAddress,
char * localFileName,
char * remoteFileName )
 

Upload a file to the remote server. If upload fails because it is unable to write to the remote server or a network error occurs this function will return with a FAILED.

Parameters:
ipAddress   is IP address of remote server.
localFileName   is local file to send.
remoteFileName   is filename to use at the remote end.
Returns:
OK, FAILED< CANNOT_READ_LOCAL_FILE, INVALID_COMMAND, CANNOT_CONNECT


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