EmbLogic's Blog

Client Server communication in IPC using FIFO for 3 clients

Logfile of Project

——————————–

——————————–
RCS file: header.h,v
Working file: header.h
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
It includes basic headerfiles for FIFOs.
It contains stdio.h, fcntl.h, unistd.h, sys/types.h, sys/stat.h
It contains #ifndef HEADERS to avoid multiple declaration of heders by differnt files.
—————————-
revision 1.1    locked by: root;
date: 2015/12/21 04:54:01;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: request.h,v
Working file: request.h
head: 1.7
branch:
locks: strict
root: 1.7
access list:
symbolic names:
keyword substitution: kv
total revisions: 7;    selected revisions: 7
description:
It contains struct request
It is format of basic client request.
It contains client PID, 2 objects,operation to be performed.
—————————-
revision 1.7    locked by: root;
date: 2015/12/21 05:56:59;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.6
date: 2015/12/21 05:52:10;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.5
date: 2015/12/21 05:50:03;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.4
date: 2015/12/21 05:46:10;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.3
date: 2015/12/21 05:32:51;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.2
date: 2015/12/21 05:27:31;  author: root;  state: Exp;  lines: +1 -1
Macro of REQUESTFIFO is redefined which contains a %d which will be its PID.
—————————-
revision 1.1
date: 2015/12/21 04:56:38;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: adder.c,v
Working file: adder.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
adder has command line arguments which contains File Descriptors of pipe.
adder read request from server for adding 2 objects
adder write result(int) into server.
—————————-
revision 1.1    locked by: root;
date: 2015/12/21 04:40:12;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: client1.c,v
Working file: client1.c
head: 1.14
branch:
locks: strict
root: 1.14
access list:
symbolic names:
keyword substitution: kv
total revisions: 14;    selected revisions: 14
description:
It open the requestfifo
Write request for addition using struct request to server
Then, it reads result(int) from server.
Before reading result “resultfifo” is being created by client.
Different clients uses same requestfifo but they have unique resultfifo which is created by client itself.
—————————-
revision 1.14    locked by: root;
date: 2015/12/21 06:16:33;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.13
date: 2015/12/21 06:11:20;  author: root;  state: Exp;  lines: +7 -7
name of arr changes to client_fifo
—————————-
revision 1.12
date: 2015/12/21 05:59:17;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.11
date: 2015/12/21 05:56:32;  author: root;  state: Exp;  lines: +3 -3
arr data type changes from char * to string.
—————————-
revision 1.10
date: 2015/12/21 05:52:06;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
—————————-
revision 1.9
date: 2015/12/21 05:50:02;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
—————————-
revision 1.8
date: 2015/12/21 05:46:08;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
—————————-
revision 1.7
date: 2015/12/21 05:41:58;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.6
date: 2015/12/21 05:39:43;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
—————————-
revision 1.5
date: 2015/12/21 05:35:20;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
—————————-
revision 1.4
date: 2015/12/21 05:34:03;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.3
date: 2015/12/21 05:32:47;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
—————————-
revision 1.2
date: 2015/12/21 05:27:08;  author: root;  state: Exp;  lines: +3 -1
sprintf() is used for creating client address.
—————————-
revision 1.1
date: 2015/12/21 04:42:31;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: client2.c,v
Working file: client2.c
head: 1.2
branch:
locks: strict
root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2;    selected revisions: 2
description:
client2 request for subtraction from the server.
It writes its request from requestfifo.
And it creates the resultfifo.
And it reads result from server through resultfifo.
—————————-
revision 1.2    locked by: root;
date: 2015/12/21 06:36:30;  author: root;  state: Exp;  lines: +7 -4
client_fifo is introduced.
—————————-
revision 1.1
date: 2015/12/21 05:09:19;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: client3.c,v
Working file: client3.c
head: 1.3
branch:
locks: strict
root: 1.3
access list:
symbolic names:
keyword substitution: kv
total revisions: 3;    selected revisions: 3
description:
This client request for multiplication.
It writes request to server through requestfifo.
It creates resultfifo.
It reads result from server through resultfifo.
—————————-
revision 1.3    locked by: root;
date: 2015/12/21 06:37:03;  author: root;  state: Exp;  lines: +7 -4
client_fifo is introduced.
—————————-
revision 1.2
date: 2015/12/21 05:16:34;  author: root;  state: Exp;  lines: +1 -1
Values of objects changed.
—————————-
revision 1.1
date: 2015/12/21 05:14:09;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: multiplier.c,v
Working file: multiplier.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
It read request from server from pipe for multiplication purpose.
It prosses the request and get the result.
result is written to server through pipe.
—————————-
revision 1.1    locked by: root;
date: 2015/12/21 04:46:24;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: server.c,v
Working file: server.c
head: 1.6
branch:
locks: strict
root: 1.6
access list:
symbolic names:
keyword substitution: kv
total revisions: 6;    selected revisions: 6
description:
Ii can handle only 1 client in this revision.
requestfifo is created.
It reads the request from client.
A pipe is created by server.
This pipe is used to send request to adder.
Then, it read result(int) from adder.
through pipe.
It writes result to the client using resultfifo (of respectice client).
—————————-
revision 1.6    locked by: root;
date: 2015/12/21 06:18:23;  author: root;  state: Exp;  lines: +1 -1
client_fifo data type changes from char to string.
—————————-
revision 1.5
date: 2015/12/21 06:16:43;  author: root;  state: Exp;  lines: +1 -1
sprintf() is used for getting RESULTFIFO name.
—————————-
revision 1.4
date: 2015/12/21 06:11:34;  author: root;  state: Exp;  lines: +3 -1
client_fifo is used for RESULT_FIFO.
—————————-
revision 1.3
date: 2015/12/21 05:06:34;  author: root;  state: Exp;  lines: +3 -3
+,-,* are replaced by ‘+’,’-’,’*’ respectively in switch case of operation.
—————————-
revision 1.2
date: 2015/12/21 05:04:10;  author: root;  state: Exp;  lines: +13 -3
execl() for subtractor and multiplier are also included along with addition in a switch case which depend on operand of the request by the client.
—————————-
revision 1.1
date: 2015/12/21 04:47:51;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: subtractor.c,v
Working file: subtractor.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
It reads request from server through pipe for subtraction purpose.
It processes the request and get the result.
result is send to server by the pipe.
—————————-
revision 1.1    locked by: root;
date: 2015/12/21 04:52:26;  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>