I have run into a problem with NetIPC. I am trying to use ipcgive to give
away a socket so a son process can take over and manage the connection for the
rest of the session.
I keep getting a SOCKERR 3 Parameter bounds violation. Which the manual says
check your parameters and make sure they are on a word boundry. They are on
word boundries and I have not a clue as to where to look for the problem.
Heres the snippet of code that executes to create the son process.
void CreateSon(int ClientSock)
{
/*************************************************
* This procedure creates a son process and *
* passes the son process the socket connection *
* for the incoming connection request. *
*************************************************/
char GiveName[12];
int HPStatus=0;
int CreateStatus=0;
int FlagMask[3] = {11,10,0};
int FlagValue[3] = {0,0,0};
short Pin;
/*************************************************
* We need to give the socket away so that the *
* son process can use the socket connection. *
* We are only giving away the incoming socket. *
*************************************************/
printf("Giving away socket %d...\n",ClientSock);
ipcgive(ClientSock,GiveName,0,0,&HPStatus);
if (HPStatus != 0)
{
printf("Problem giving the socket(%d)\n",HPStatus);
IPCError(HPStatus);
ipcshutdown(ClientSock);
return;
}
/*************************************************
* Now create the son process. If it fails we *
* need to get the socket back and close it. *
*************************************************/
printf("Creating son process to handle socket %d...\n",ClientSock);
GiveName[8] = '\0';
FlagValue[0] = (int)GiveName;
createprocess (&CreateStatus, &Pin, "CheckSon", FlagMask, FlagValue);
if (ccode() != CCE)
{
printf("Could not create son process to handle socket.\n");
ipcget(GiveName,8,0,&ClientSock,&HPStatus);
if (HPStatus == 0)
ipcshutdown(ClientSock);
else
{
printf("Problem getting the socket back(%d)\n",HPStatus);
IPCError(HPStatus);
}
}
else
IncrementSonCount();
}
Any clues would be very helpful
thanks
Rabi Satter
Open Skies
|