Enhanced to allow clients to submit requests to different remote

endpoints.
This commit is contained in:
Juan Carlos Luciani
2006-09-04 06:10:09 +00:00
parent 48d4d947ea
commit 960d27db69
5 changed files with 1064 additions and 461 deletions

View File

@@ -74,7 +74,8 @@ bool errorDetected = false;
//++=======================================================================
void* SubmitThread()
void* SubmitThread(
uint32_t remoteEndPointHandle)
//
// Arguments:
//
@@ -102,7 +103,8 @@ void* SubmitThread()
pthread_mutex_unlock(&testMutex);
// Submit request to the server
if (IpcClientSubmitReq(reqData,
if (IpcClientSubmitReq(remoteEndPointHandle,
reqData,
strlen(reqData),
&pReplyData,
&replyDataLen) != 0)
@@ -148,6 +150,7 @@ ExecuteTests(void)
int threadCreateStatus;
int threadCreatedCount = 0;
int i;
uint32_t endPointHandle;
DbgTrace(1, "ExecuteTests- Start\n", 0);
@@ -158,8 +161,10 @@ ExecuteTests(void)
false) == 0)
{
// Set the server listen address
if (IpcClientSetInAddress(5000,
0x7F000001) == 0)
if (IpcClientOpenInetRemoteEndPoint(5000,
0x7F000001,
0,
&endPointHandle) == 0)
{
// Start the configured number of threads to submit requests to
// the server.
@@ -168,7 +173,7 @@ ExecuteTests(void)
threadCreateStatus = pthread_create(&thread,
NULL,
(void*(*)(void*))SubmitThread,
(void*)NULL);
(void*)endPointHandle);
if (threadCreateStatus == 0)
threadCreatedCount ++;
else
@@ -185,10 +190,16 @@ ExecuteTests(void)
sleep(1);
sleep(1);
}
// Close the remote endpoint
if (IpcClientCloseRemoteEndPoint(endPointHandle) != 0)
{
DbgTrace(0, "ExecuteTests- Error closing remote endpoint\n", 0);
}
}
else
{
DbgTrace(0, "ExecuteTests- Error setting server address\n", 0);
DbgTrace(0, "ExecuteTests- Error opening remote endpoint\n", 0);
}
IpcClientShutdown();