version 1.1.2.2, 2006/04/24 19:29:05
|
version 1.1.2.3, 2006/04/27 16:11:32
|
|
|
optionCount = sizeof(testOptionsTable) / sizeof(testOptionsTable[0]); | optionCount = sizeof(testOptionsTable) / sizeof(testOptionsTable[0]); |
optionsTable = testOptionsTable; | optionsTable = testOptionsTable; |
} | } |
/*/////////////////////////////////////////////////////////////// |
/** |
OPTION MANAGEMENT | OPTION MANAGEMENT |
///////////////////////////////////////////////////////////////*/ |
*/ |
| |
/** GetOptions function - This function sets up the options from | /** GetOptions function - This function sets up the options from |
testOptionsTable which is initialized through constructor | testOptionsTable which is initialized through constructor |
|
|
int counter = 0; | int counter = 0; |
String argument = String::EMPTY; | String argument = String::EMPTY; |
| |
/** om.registerOptions(newOptionsTable, (const)cOptionCount); */ |
|
|
// |
|
// om.registerOptions(newOptionsTable, (const)cOptionCount); |
|
// |
om.registerOptions(newOptionsTable, cOptionCount); | om.registerOptions(newOptionsTable, cOptionCount); |
argvv = argv; | argvv = argv; |
| |
/** Following section is introduced to ignore options not |
// |
required by a client. |
// Following section is introduced to ignore options not |
*/ |
// required by a client. |
|
// |
for (int i = 1; i < argc; i++) | for (int i = 1; i < argc; i++) |
{ | { |
argument = String::EMPTY; | argument = String::EMPTY; |
const char* arg = argv[i]; | const char* arg = argv[i]; |
| |
/** Check for - option. */ |
// |
|
// Check for - option. |
|
// |
if (*arg == '-') | if (*arg == '-') |
{ | { |
/** Look for the option. */ |
// |
|
// Look for the option. |
|
// |
argument.append(arg + 1); | argument.append(arg + 1); |
const Option* option = om.lookupOption(argument); | const Option* option = om.lookupOption(argument); |
| |
/** Get the option argument if any. */ |
// |
|
// Get the option argument if any. |
|
// |
if (option) | if (option) |
{ | { |
argvv[++counter]=argv[i]; | argvv[++counter]=argv[i]; |
|
|
| |
Uint32 whileCount = 0; | Uint32 whileCount = 0; |
| |
/** Get current time for time stamp */ |
// |
|
// Get current time for time stamp |
|
// |
nowMilliseconds = TimeValue::getCurrentTime().toMilliseconds(); | nowMilliseconds = TimeValue::getCurrentTime().toMilliseconds(); |
| |
sprintf(pid_str, "%d", clientPid); | sprintf(pid_str, "%d", clientPid); |
|
|
successPercentage = (successCount/totalCount)*100; | successPercentage = (successCount/totalCount)*100; |
errorPercentage = 100 - successPercentage; | errorPercentage = 100 - successPercentage; |
| |
/** loging details here */ |
// |
|
// loging details here |
|
// |
ofstream errorLog_File(clientLog.getCString(), ios::app); | ofstream errorLog_File(clientLog.getCString(), ios::app); |
errorLog_File<<client<<" PID#"<<clientPid<<" ran "<<totalCount | errorLog_File<<client<<" PID#"<<clientPid<<" ran "<<totalCount |
<<" times with a "<<errorPercentage<<"% failure"<<"\n"; | <<" times with a "<<errorPercentage<<"% failure"<<"\n"; |
|
|
String &clientLog, | String &clientLog, |
String &message) | String &message) |
{ | { |
/** loging details here .*/ |
// |
|
// loging details here . |
|
// |
ofstream errorLog_File(clientLog.getCString(), ios::app); | ofstream errorLog_File(clientLog.getCString(), ios::app); |
errorLog_File<<" PID#"<<clientPid<<"::"<<message<<"\n"; | errorLog_File<<" PID#"<<clientPid<<"::"<<message<<"\n"; |
errorLog_File.close(); | errorLog_File.close(); |
|
|
/** This method handles the SSLCertificate verification part. */ | /** This method handles the SSLCertificate verification part. */ |
static Boolean verifyCertificate(SSLCertificateInfo &certInfo) | static Boolean verifyCertificate(SSLCertificateInfo &certInfo) |
{ | { |
/** Add code to handle server certificate verification. */ |
// |
|
// Add code to handle server certificate verification. |
|
// |
return true; | return true; |
} | } |
| |
|
|
{ | { |
if (useSSL) | if (useSSL) |
{ | { |
/** Get environment variables. */ |
// |
|
// Get environment variables. |
|
// |
const char* pegasusHome = getenv("PEGASUS_HOME"); | const char* pegasusHome = getenv("PEGASUS_HOME"); |
| |
String trustpath = FileSystem::getAbsolutePath( | String trustpath = FileSystem::getAbsolutePath( |
|
|
trustpath, verifyCertificate, randFile); | trustpath, verifyCertificate, randFile); |
if (verboseTest) | if (verboseTest) |
{ | { |
PEGASUS_STD(cout) << "connecting to " << host << ":" |
cout << "connecting to " << host << ":" |
<< portNumber << " using SSL" | << portNumber << " using SSL" |
<< PEGASUS_STD(endl); |
<< endl; |
} | } |
client->connect (host, portNumber, sslContext, userName, password); | client->connect (host, portNumber, sslContext, userName, password); |
} /* useSSL. */ | } /* useSSL. */ |
|
|
{ | { |
if (verboseTest) | if (verboseTest) |
{ | { |
PEGASUS_STD(cout) << "Connecting to " << host << ":" << portNumber |
cout << "Connecting to " << host << ":" << portNumber |
<< PEGASUS_STD(endl); |
<< endl; |
} | } |
client->connect (host, portNumber, userName, password); | client->connect (host, portNumber, userName, password); |
} | } |
if (verboseTest) | if (verboseTest) |
{ | { |
PEGASUS_STD(cout) << "Client Connected" << PEGASUS_STD(endl); |
cout << "Client Connected" << endl; |
} | } |
} | } |