EmbLogic's Blog

client server communication using pipe and signal

—in this program i’ve used the pipe for communication between server and three client.while single pipe for commmunication between processes and server.
for synchronisation i’ve used signal handler.signal(SIGUSR1,ouch).
—–program for server——

RCS file: ./server.c,v
Working file: ./server.c
head: 1.5
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 5; selected revisions: 5
description:
working for second client
created a pipe an
for communication between server and client2
—————————-
revision 1.5
date: 2014/07/06 12:05:00; author: root; state: Exp; lines: +110 -57
the server used three pipe for communication between three client
and single pipe for communication between process and server
for sync i’ve used signal sigusr
—————————-
revision 1.4
date: 2014/07/05 08:35:03; author: root; state: Exp; lines: +45 -7
make a new pipe for client3
recieve the data from client3 and proceed it to process 3
the process3 use the common pipe for all the three process
for sync i’ve used sleep
—————————-
revision 1.3
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
=============================================================================
———–program for client—————–

RCS file: client1.c,v
Working file: client1.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 client i’ve used if else condition
in the if condition it compare with the flag which has sent by server
for client1 i’ve sent message “client1″ to client when the if condition true then the client
receive the output
in else condition the client write the data to server
for sync i’ve used signal
—————————-
revision 1.1 locked by: root;
date: 2014/07/06 12:36:43; author: root; state: Exp;
Initial revision
============================================================================

***************process——————
RCS file: process1.c,v
Working file: process1.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
—————————-
revision 1.1 locked by: root;
date: 2014/07/06 13:03:08; 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>