Changes due to continue development of the IpcLibs. Not done yet.

This commit is contained in:
Juan Carlos Luciani
2006-09-01 05:37:43 +00:00
parent 4326223276
commit f45c0f4c9e
10 changed files with 64 additions and 215 deletions

View File

@@ -62,7 +62,7 @@ CPPFILES = channelproto.cpp \
CSFILES_CSC :=
INCLUDES = -I. -I.. -I../common -I../../../../include
RESOURCES =
DEFINES += -Wno-format-extra-args -fno-strict-aliasing
DEFINES += -Wno-format-extra-args -fno-strict-aliasing -fshort-wchar
CFLAGS += $(INCLUDES) $(DEFINES)
CPPFLAGS += $(INCLUDES) $(DEFINES)
LIBS = -lpthread -ldl -lexpat

View File

@@ -558,6 +558,8 @@ SChannel::sendReplyData(
ioVectors[1].iov_len = serverDataLen;
sendmsgHdr.msg_iov = ioVectors;
sendmsgHdr.msg_iovlen = 2;
printf("SChannel::sendReplyData- Sending %d header bytes\n", sizeof(reqDataPktHdr));
printf("SChannel::sendReplyData- Sending %d payload bytes\n", serverDataLen);
while (1)
{
bytesSent = sendmsg(m_socket,
@@ -619,14 +621,11 @@ SChannel::sendReplyError(
//
// Notes:
//
// L0
// L1
//=======================================================================--
{
int retStatus = -1;
char reqErrorPktHdr[ReqErrorPktHdrTemplate.length()];
struct msghdr sendmsgHdr = {0};
struct iovec ioVectors[2];
unsigned long bytesSent;
DbgTrace(1, "SChannel::sendReplyError- Start, Obj = %08X\n", this);

View File

@@ -134,10 +134,10 @@ ServiceRequest(
//
// Notes:
//
// L0
// L1
//=======================================================================--
{
int retStatus = -1;
int retStatus = -1;
DbgTrace(1, "ServiceRequest- Start\n", 0);
@@ -197,7 +197,7 @@ AbortPendingRequests(void)
//
// Notes:
//
// L0
// L2
//=======================================================================--
{
DbgTrace(1, "AbortPendingRequests- Start\n", 0);
@@ -237,7 +237,7 @@ AwakenSuspendedServerThreads(void)
//
// Notes:
//
// L0
// L2
//=======================================================================--
{
DbgTrace(1, "AwakenSuspendedServerThreads- Start\n", 0);
@@ -662,7 +662,7 @@ void* ServiceConnectionsThread(void)
//
// Notes:
//
// L0
// L2
//=======================================================================--
{
DbgTrace(1, "ServiceConnectionsThread- Start\n", 0);
@@ -707,7 +707,7 @@ IpcServerGetRequest(void)
// An application can execute this method from multiple
// threads to allow requests to be process concurrently.
//
// L0
// L1
//=======================================================================--
{
int32_t requestId = 0;
@@ -724,7 +724,7 @@ IpcServerGetRequest(void)
try {
// Instantiate ServerThread object
ServerThread *pServerThread = new ServerThread();
ServerThread serverThread;
// Obtain server mutex
pthread_mutex_lock(&serverMutex);
@@ -759,7 +759,7 @@ IpcServerGetRequest(void)
nextReqId = 2;
}
// Place the request in the pending request map
// Place the request in the active request map
RSIterBoolPair insertResult = rsMap.insert(make_pair(requestId, pServerReq));
if (!insertResult.second)
{
@@ -786,17 +786,14 @@ IpcServerGetRequest(void)
{
// There is not a request for us to process, place us on the waiting
// server thread list and wait to be awaken.
waitingServerThreadList.push_back(pServerThread);
waitingServerThreadList.push_back(&serverThread);
waitingServerThreads ++;
pServerThread->suspend(&serverMutex);
serverThread.suspend(&serverMutex);
}
}
// Release server mutex
pthread_mutex_unlock(&serverMutex);
// Free ServerThread object
delete pServerThread;
}
catch (...) {
@@ -833,7 +830,7 @@ IpcServerGetRequestData(
// Notes: The returned buffer SHOULD NOT be released by the calling
// application.
//
// L0
// L1
//=======================================================================--
{
int32_t reqDataLen = 0;
@@ -899,7 +896,7 @@ IpcServerCompleteRequest(
//
// Notes: The returned buffer will not NOT be released by the method.
//
// L0
// L1
//=======================================================================--
{
DbgTrace(1, "IpcServerCompleteRequest- Start, requestId = %08X\n", requestId);
@@ -961,7 +958,7 @@ IpcServerAbortRequest(
//
// Notes:
//
// L0
// L1
//=======================================================================--
{
DbgTrace(1, "IpcServerAbortRequest- Start, requestId = %08X\n", requestId);
@@ -1024,7 +1021,7 @@ IpcServerStart(void)
// Note: The service needs to be initialized and the listen address
// needs to be set before calling this procedure.
//
// L0
// L2
//=======================================================================--
{
int retStatus = -1;
@@ -1088,7 +1085,7 @@ IpcServerSetUnAddress(
//
// Note: The service needs to be initialized before calling this procedure.
//
// L0
// L1
//=======================================================================--
{
int retStatus = -1;
@@ -1097,7 +1094,7 @@ IpcServerSetUnAddress(
// Verify the input parameters
if (pSocketFileName == NULL
|| strlen(pSocketFileName) >= sizeof(pSocketFileName))
|| strlen(pSocketFileName) >= sizeof(listenSocketFile))
{
DbgTrace(0, "IpcServerSetUnAddress- Invalid input parameter\n", 0);
goto exit;
@@ -1157,7 +1154,7 @@ IpcServerSetInAddress(
//
// Note: The service needs to be initialized before calling this procedure.
//
// L0
// L2
//=======================================================================--
{
int retStatus = -1;
@@ -1237,7 +1234,7 @@ IpcServerInit(
// Note: It is necessary to call the start procedure to start
// servicing requests.
//
// L0
// L2
//=======================================================================--
{
int retStatus = -1;
@@ -1299,7 +1296,7 @@ IpcServerShutdown(void)
//
// Note:
//
// L0
// L2
//=======================================================================--
{
DbgTrace(1, "IpcServerShutdown- Start\n", 0);