EmbLogic's Blog

Client Server setup using Pipes….

For making a client server set up, you need to know how a child process create by parent process. A parent process makes a child process by using fork() system call.

Fork (system call):-

fork is an operation whereby a process creates a copy of itself. It is usually a system call, implemented in the kernal. Fork is the primary (and historically, only) method of process creation on Unix-like operating systems.fork() creates a new process by duplicating the calling process. The new process, referred to as the child, is an exact duplicate of the calling process, referred to as the parent. Fork() system call makes a child process and return child’s pid(pid means unique process id).

Now next you have to make pipe between the client and server for communication between them.

Pipes:-

A pipe is medium to communicate between processes which have something common between them. A pipe is created by pipe(int arr[2]) whose argument is an integer type of array which stores 2 descriptors(one for read and one for write). Data can be write and read from pipe through these descriptors.

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>