class CAVERNnet_http_c

A class to load files from WEB servers

Public Fields

static const int NO_TIME_OUT
Turn timeout off when loading from WEB page.

Public Methods

void setTimeOut (int timep)
Set the timeout period during WEB page loading.
int grabWEBFile ()
Grab the WEB file
void 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
int logStats (char* streamInfo, char* comment, FILE* filePtr)
This logs performance statistics in a file
int 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)

int 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
void exitSendStats ()
Properly delete the perFDaemon Client after sendStats is done

Public


SetMode flags.
static const int AUTO_LOAD
Autoload from WEB page checking local cached file.
static const int CHECK_BUT_DONT_LOAD
Check the status of WEB page.
static const int FORCED_LOAD
Force a load from the WEB page ignoring the cache.

Accessor functions.
void setRemoteSite (char *site)
Set the IP address of remote site.
void setRemotePath (char *path)
Set the path from the remote site.
void setRemoteFile (char *file)
Set the remote file to download.
void setLocalPath (char *path)
Set the local path to store downloaded file.
void setLocalFile (char *file)
Set the local file to store downloaded file.
void setMode (int mode)
Set download mode
int getTimeOut ()
Get timeout period.
char* getRemoteSite ()
Counterpart of SetRemoteSite.
char* getRemotePath ()
Counterpart of SetRemotePath.
char* getRemoteFile ()
Counterpart of SetRemoteFile.
char* getLocalPath ()
Counterpart of SetLocalPath.
char* getLocalFile ()
Counterpart of GetLocalFile.
int getMode ()
Counterpart of SetMode.

Documentation

A class to load files from WEB servers.

This is a class to grab a file off a WEB site depending on whether the local cached version is older than the remote one.

Begin by creating a webget object. Using the accessor functions, assign to it the remote WEB address, path and file. Then assign the local path and file.

Call SetMode to choose the operation you wish.

Finally call GrabWEBFile and check the return status.

void setMode(int mode)
Set download mode
Parameters:
mode - Set to either AUTO LOAD, FORCED LOAD or CHECK BUT DONT LOAD.
See Also:
SetMode Flags.

int grabWEBFile()
Grab the WEB file. Mode of grab is determined by SetMode method.
Returns:
200 if modified and downloaded ok. -1 if timed out but cache file exists. -11 if timed out but cache file DOES NOT exist. -2 if cannot connect. -3 if get of file successful but rename of tmpfile failed. -4 if unable to write to local file. -5 if modified : only for CHECK_BUT_DONT_LOAD mode. -6 if unable to get the content length of the remote file. else returns WEB status numbers. e.g. 304 is file not modified. 404 is file not found.

void 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 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.

Returns:
Either CAVERNnet_perfMonitor_c::OK or CAVERNnet_perfMonitor_c::FAILED
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

int 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)

Returns:
Either CAVERNnet_perfMonitor_c::OK or CAVERNnet_perfMonitor_c::FAILED
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 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.

Returns:
Either CAVERNnet_perfMonitor_c::OK or CAVERNnet_perfMonitor_c::FAILED
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.


This class has no child classes.
Author:
(C) 1997 Jason Leigh.
Version:
4/1/97.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de