Main Page   Class Hierarchy   Compound List   File List   Compound Members  

CAVERNnet_perfClient_c.hxx

00001 /******************************************************************
00002  * CAVERNsoft
00003  * Copyright (C) 1994-2000 Electronic Visualization Laboratory,
00004  * all rights reserved
00005  * By Jason Leigh, Yong-joo Cho, Naveen Krishnaprasad, Chris Scharver,
00006  * Stuart Bailey, Atul Nayak, Shalini Venkataraman
00007  * University of Illinois at Chicago
00008  * 
00009  * This publication and its text and code may not be copied for commercial 
00010  * use without the express written permission of the University of Illinois
00011  * at Chicago.
00012  * The contributors disclaim any representation of warranty: use this
00013  * code at your own risk.
00014  * Direct questions, comments etc to cavern@evl.uic.edu
00015  ******************************************************************/
00016 
00017 #ifndef _CAVERNPLUS_PERF_CLIENT
00018 #define _CAVERNPLUS_PERF_CLIENT
00019 
00020 #include <stdio.h>
00021 
00022 #define PERF_DAEMON_DEFAULT_PORT        9500
00023 #define REGISTER_PERF_CLIENT "$$CAVERN_PERF_DAEMON_CLASS$$"
00024 #define SEND_STAT_CLIENT     "$$SEND_STAT_PERF_CLIENT$$$$$"
00025 #define REGISTER_PERF_CLIENT_LENGTH 28 // length of REGISTER_PERF_CLIENT string
00026 #define SEND_STAT_CLIENT_LENGTH 28 // length of SEND_STAT_CLIENT string
00027 #define CLOSING_STAT_CLIENT  "$$CLOSING_STAT_PERF_CLIENT$$"
00028 #define CLOSING_STAT_CLIENT_LENGTH 28
00029 #define CLOSING_PERF_CLIENT  "$$CLOSING_PERF_DAEMON_CLASS$"
00030 #define CLOSING_PERF_CLIENT_LENGTH 28
00031 
00032 class CAVERNnet_tcpClient_c;
00033 
00055 class CAVERNnet_perfDaemonClient_c 
00056 {
00057 private:
00058         CAVERNnet_tcpClient_c *client;
00059         int timeOut;
00060         int connectionAlive;
00061     int perfClient;
00062 
00063 public:
00065 
00066         static const int OK/* = 1*/;
00067 
00069         static const int FAILED/* = 2*/;
00070 
00072         static const int MEM_ALLOC_ERR/* = 3*/;
00073 
00075         static const int NON_BLOCKING_HAS_NO_DATA/* = 7*/;
00076 
00078         static const int CONNECTION_TERMINATED/* = 8*/;
00079 
00081         static const int NOT_READY/* = 9*/;
00082 
00084         static const int READY_TO_READ/* = 10*/;
00085 
00087         static const int READY_TO_WRITE/* = 11*/;
00088 
00090         static const int READY_TO_READ_AND_WRITE/* = 12*/;
00091 
00092         static const int BLOCKING/* = CAVERNnet_tcpClient_c::BLOCKING*/;
00093         static const int NON_BLOCKING/* = CAVERNnet_tcpClient_c::NON_BLOCKING*/;
00094 
00095         static const int NO_TIME_OUT/* = CAVERNnet_tcpClient_c::NO_TIME_OUT*/;
00096 
00098 
00104         CAVERNnet_perfDaemonClient_c(int isPerfClient = 0);       
00105 
00107         CAVERNnet_perfDaemonClient_c(CAVERNnet_tcpClient_c*, int isPerfClient = 0);
00108         ~CAVERNnet_perfDaemonClient_c();
00109 
00118         int read(char** ret, int* nbytes, int blockingType);
00119 
00125         int write(char *outgoingData, int* nbytes);
00126 
00131         int isReadyToRead();
00132 
00137         int isReadyToWrite();
00138 
00145         int isReady();
00146 
00148 
00149 
00153         unsigned int getRemoteIP();
00154 
00159         void getRemoteIP(char* name);
00160 
00162         unsigned int getSelfIP();
00163 
00165         void getSelfIP(char *name);
00166 
00168         int  getSelfPort();
00169 
00171         int  getRemotePort();
00173 
00175         void showStatus(int status, int nbytes);
00176 
00178         void showStats();
00179 
00181         void close();
00182 
00188         int connectToServer(char *ip, int port=PERF_DAEMON_DEFAULT_PORT);
00189 
00198         void setTimeOut(int timeout=CAVERNnet_perfDaemonClient_c::NO_TIME_OUT);
00199 };
00200 #endif
00201 

Generated at Mon Jul 2 14:24:42 2001 for CAVERNsoft by doxygen1.2.8-20010617 written by Dimitri van Heesch, © 1997-2001