EmbLogic's Blog

client server communication using pipe

i’ve done this program for two client —
inside this program i have to client which need two different action(operation) .the server accept the request of client by using pipe .to perform their desired operation the server again sent this data to process by using pipe.for both operation i have used single pipe for process1 and process2.after processing the sever request the process1 or process2 wrote the output in pipe which fetched by server.and sever use the respective pipe of client1 and client2 and write this output to client pipe which is then fetched by client.
to manage the sychronisation i’ve use sleep.we can also used signal for proper sync.
——server……….

RCS file: server.c,v
Working file: server.c
head: 1.3
branch:
locks: strict
root: 1.3
access list:
symbolic names:
keyword substitution: kv
total revisions: 3; selected revisions: 3
description:
working for second client
created a pipe an
for communication between server and client2
—————————-
revision 1.3 locked by: root;
date: 2014/07/05 04:02:23; author: root; state: Exp; lines: +26 -5
in server for the client_2 i add a pipe between the client2 and server
by using the previous pipe which is between process1 and server
i used data communication between server and process2
to sync i used sleep as per requirement
—————————-
revision 1.2
date: 2014/07/04 18:58:33; author: root; state: Exp; lines: +7 -4
creating new pipe for process2
—————————-
revision 1.1
date: 2014/07/04 17:21:57; author: root; state: Exp;
Initial revision
=============================================================================

—-client—–

RCS file: ./client2.c,v
Working file: ./client2.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
created a client2.c function
which provides the data to server
by using pipe
and again after processing the data it receive the data from server by using same pipe
for the sync. i used sleep
as per needed
—————————-
revision 1.1 locked by: root;
date: 2014/07/05 04:06:40; author: root; state: Exp;
Initial revision
=============================================================================
——process—–

RCS file: ./process2.c,v
Working file: ./process2.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
in the process2 i used the same pipe which has been previously used
between process1 and server
in the process i perform the operation as per operator
after performing operation process2 return the result to the server
—————————-
revision 1.1 locked by: root;
date: 2014/07/05 04:08:53; author: root; state: Exp;
Initial revision
=============================================================================

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>