EmbLogic's Blog

IPC

Client Server using IPC

 

IPC stands for inter process communation and with help of this mechanism server can communicate with their appropriate clients.

There are four types of IPC

1)Pipe

2)fifo

3)message queues

4)shared memory

 

pipe-It is mechanism in which dataflow connect from one process to another.It can occurs only in related process.

The prototype of pipe can be written as

int pipe( fd[2] )

fifo-It is mechanism in which external process also connect with this client server process.It can occurs in related as well as unrelated process also

message queues-It is a mechanism in which we can send unrelated process in easy and efficient way.

It independent of both sending and receiving process

shared queues-It is used to send data between two runnind process.

The project client server using pipe we are using various terms like client,server,processing client,fork(),execl().There are three client ,three processing client and one server is used.

Client who sends the request to the server and server send their request to processing client to process the request after processing the request ,processing resend the information to server and server send to client.In this way server responding the request of client.

It is works as program create a pipe and then fork,creating a child process.both have a file discripter that access the file,one for each reading and writing.so,there are four file descripter in total

Client generate a process by using fork() and send these process to server .server has method execl() through which server will get data from client.

Hence the real advantage of using pipe when we wish to pass a data from one process to another.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>