Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

TestSRPC.C File Reference

#include <stdlib.h>
#include <time.h>
#include <sys/time.h>
#include <signal.h>
#include <stdio.h>
#include <Basics.H>
#include <TCP_sock.H>
#include <SRPC.H>
#include <LimService.H>
#include <MultiSRPC.H>
#include "Debug.H"

Go to the source code of this file.

Classes

struct  ClientArgs

Functions

void WriteFailure (const SRPC::failure &f, int threadId=-1) throw ()
void WriteIdInfo (SRPC *srpc) throw (SRPC::failure)
void ServerCallback (SRPC *srpc, int procId, void *unused) throw (SRPC::failure)
void ExitServer () throw ()
void Server (int argc, char *argv[]) throw ()
void ExitClient () throw ()
void * MainClientProc (void *ptr) throw ()
void * ClientProc (void *ptr) throw ()
void Client (int argc, char *argv[]) throw ()
int main (int argc, char *argv[])

Variables

const Text ClientSwitch = "-client"
const Text ServerSwitch = "-server"
char *const IntfName = "9874"
int const IntfVersion = 1
int const FirstProcId = 1
int const LastProcId = 2
bool sWait = false


Function Documentation

void Client int  argc,
char *  argv[]
throw ()
 

Definition at line 314 of file TestSRPC.C.

References Debug::BlockForever(), ClientProc(), ClientArgs::conns, ClientArgs::cWait, ExitClient(), Basics::thread::fork_and_detach(), ClientArgs::hostname, ClientArgs::id, IntfName, IntfVersion, Debug::Lock(), NEW, NEW_CONSTR, NEW_PTRFREE_ARRAY, Debug::Timestamp(), Debug::Unlock(), and ClientArgs::waitTime.

Referenced by main().

void* ClientProc void *  ptr  )  throw ()
 

Definition at line 297 of file TestSRPC.C.

References ClientArgs::cWait, Basics::thread::fork(), Basics::thread::join(), MainClientProc(), Debug::MyRand(), and ClientArgs::waitTime.

Referenced by Client().

void ExitClient  )  throw ()
 

Definition at line 202 of file TestSRPC.C.

References ExitClient().

Referenced by Client(), and ExitClient().

void ExitServer  )  throw ()
 

Definition at line 163 of file TestSRPC.C.

Referenced by Server().

int main int  argc,
char *  argv[]
 

Definition at line 390 of file TestSRPC.C.

References Client(), and Server().

void* MainClientProc void *  ptr  )  throw ()
 

Definition at line 218 of file TestSRPC.C.

References ClientArgs::conns, ClientArgs::cWait, MultiSRPC::End(), FirstProcId, ClientArgs::hostname, ClientArgs::id, IntfVersion, LastProcId, Debug::Lock(), Debug::MyRand(), Pause(), SRPC::recv_end(), SRPC::recv_int(), SRPC::send_end(), SRPC::send_int(), MultiSRPC::Start(), SRPC::start_call(), Debug::Timestamp(), Debug::Unlock(), ClientArgs::waitTime, WriteFailure(), and WriteIdInfo().

void Server int  argc,
char *  argv[]
throw ()
 

Definition at line 170 of file TestSRPC.C.

References ExitServer(), IntfName, IntfVersion, Debug::Lock(), LimService::Run(), ServerCallback(), Debug::Unlock(), and WriteFailure().

Referenced by main().

void ServerCallback SRPC srpc,
int  procId,
void *  unused
throw (SRPC::failure)
 

Definition at line 109 of file TestSRPC.C.

References Debug::Lock(), Debug::MyRand(), Pause(), Debug::Timestamp(), Debug::Unlock(), WriteFailure(), and WriteIdInfo().

Referenced by Server().

void WriteFailure const SRPC::failure f,
int  threadId = -1
throw ()
 

Definition at line 88 of file TestSRPC.C.

References Debug::Lock(), SRPC::failure::msg, SRPC::failure::r, Debug::Timestamp(), and Debug::Unlock().

Referenced by MainClientProc(), Server(), and ServerCallback().

void WriteIdInfo SRPC srpc  )  throw (SRPC::failure)
 

Definition at line 98 of file TestSRPC.C.

Referenced by MainClientProc(), and ServerCallback().


Variable Documentation

const Text ClientSwitch = "-client"
 

Definition at line 68 of file TestSRPC.C.

int const FirstProcId = 1
 

Definition at line 73 of file TestSRPC.C.

Referenced by MainClientProc().

char* const IntfName = "9874"
 

Definition at line 70 of file TestSRPC.C.

Referenced by Client(), and Server().

int const IntfVersion = 1
 

Definition at line 71 of file TestSRPC.C.

Referenced by Client(), ClientCall(), MainClientProc(), and Server().

int const LastProcId = 2
 

Definition at line 74 of file TestSRPC.C.

Referenced by MainClientProc().

const Text ServerSwitch = "-server"
 

Definition at line 69 of file TestSRPC.C.

bool sWait = false
 

Definition at line 107 of file TestSRPC.C.


Generated on Mon May 8 00:49:01 2006 for Vesta by  doxygen 1.4.2