PROJECT-03(IPC USING PIPES)
As per the project-03 class from “IPC” using “PIPES”.This process is based on IPC technique.It is inter process communication which is create a client server setup.It is a client server programming.
There are four types of IPC’s
>>Pipes
>>Fifo’s
>>MesageQueues
>>Shared Memory
Here it is a low level programming language which it is define as:
>>can operate in resource constraint enviroment
>>run time library
>>It is very efficient
>>memory access and control flow
>>debugging can be difficult it can not be possible to run the program.
PIPES:It use the term pipe when it connect the data flow one process to another.Generally it attach pipe the output of the process to the input of the another.
In this mechanism limitd facilities are available.Here should be a server program one client shoud be a send request and the other server would find the client to process the request to server after it invokes the new client so as to process the request.There should be a new client then send a result back to the server,which after it sends data forward to the requesting client.In this process we must use the low level these are file descriptor[fd] so read and write call to access the data rather than fread and fwrite.
In IPC here can be use two methods in pipes:
>>Fork
>>Execl
FORK:It is a function fork()which is used to generate the process and it is used in inter process communication as ret=fork().When we get fork then fork is made two process named “parent id” and ‘child id’ which has same address.
EXECL:Execl() is used to invoke the pipe program through which server will get the client.the argument to execl are:
>>The program to invoke
>>argv[0],which takes the program name
>>aggv[1],which contains the file discriptor number we want the program to read from
>>(char *)0,which terminates the parameters.