EmbLogic's Blog

CIient Server using IPC for FIFO,Pipes and Signals for n clients

RCS file: header.h,v
Working file: header.h
head: 1.2
branch:
locks: strict
root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2;    selected revisions: 2
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.2    locked by: root;
date: 2016/01/01 02:10:15;  author: root;  state: Exp;  lines: +1 -0
signal.h is included for using kill operation.
—————————-
revision 1.1
date: 2015/12/21 04:54:01;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: request.h,v
Working file: request.h
head: 1.19
branch:
locks: strict
root: 1.19
access list:
symbolic names:
keyword substitution: kv
total revisions: 19;    selected revisions: 19
description:
It contains struct request
It is format of basic client request.
It contains client PID, 2 objects,operation to be performed.
—————————-
revision 1.19    locked by: root;
date: 2016/01/06 10:22:24;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.18
date: 2016/01/04 11:02:29;  author: root;  state: Exp;  lines: +1 -1
maximum clients are changed from 1000 to 10000.
—————————-
revision 1.17
date: 2016/01/04 10:39:25;  author: root;  state: Exp;  lines: +1 -1
No. of MAX_CLIENT increased to 1000.
—————————-
revision 1.16
date: 2016/01/01 02:30:39;  author: root;  state: Exp;  lines: +1 -1
No. of clients = 100
—————————-
revision 1.15
date: 2016/01/01 02:13:15;  author: root;  state: Exp;  lines: +2 -0
signal.h is included.
—————————-
revision 1.14
date: 2015/12/21 09:54:15;  author: root;  state: Exp;  lines: +1 -1
CIIENT_MAX = 5
—————————-
revision 1.13
date: 2015/12/21 09:45:17;  author: root;  state: Exp;  lines: +1 -1
No. of clients increased to 1114.
—————————-
revision 1.12
date: 2015/12/21 09:27:52;  author: root;  state: Exp;  lines: +1 -1
No. of clients is 114.
—————————-
revision 1.11
date: 2015/12/21 09:13:31;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.10
date: 2015/12/21 09:07:47;  author: root;  state: Exp;  lines: +1 -1
No. of clients is increased from 4 to 5.
—————————-
revision 1.9
date: 2015/12/21 08:50:23;  author: root;  state: Exp;  lines: +1 -1
No. of MAX_CLIENT becomes 4
—————————-
revision 1.8
date: 2015/12/21 07:09:44;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
—————————-
revision 1.7
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.4
branch:
locks: strict
root: 1.4
access list:
symbolic names:
keyword substitution: kv
total revisions: 4;    selected revisions: 4
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.4    locked by: root;
date: 2016/01/06 08:52:29;  author: root;  state: Exp;  lines: +1 -1
signal is removed.
—————————-
revision 1.3
date: 2016/01/01 02:07:16;  author: root;  state: Exp;  lines: +2 -1
alarm signal is send to server after it writes result to server
—————————-
revision 1.2
date: 2015/12/21 09:59:14;  author: root;  state: Exp;  lines: +1 -1
print statement decreased.
—————————-
revision 1.1
date: 2015/12/21 04:40:12;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: client1.c,v
Working file: client1.c
head: 1.15
branch:
locks: strict
root: 1.15
access list:
symbolic names:
keyword substitution: kv
total revisions: 15;    selected revisions: 15
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.15    locked by: root;
date: 2015/12/21 10:05:47;  author: root;  state: Exp;  lines: +5 -5
print staements removed
—————————-
revision 1.14
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.3
branch:
locks: strict
root: 1.3
access list:
symbolic names:
keyword substitution: kv
total revisions: 3;    selected revisions: 3
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.3    locked by: root;
date: 2015/12/21 10:06:09;  author: root;  state: Exp;  lines: +4 -4
print staements removed
>
—————————-
revision 1.2
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.4
branch:
locks: strict
root: 1.4
access list:
symbolic names:
keyword substitution: kv
total revisions: 4;    selected revisions: 4
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.4    locked by: root;
date: 2015/12/21 10:06:20;  author: root;  state: Exp;  lines: +5 -5
print staements removed
—————————-
revision 1.3
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: client4.c,v
Working file: client4.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 modulo (%)
—————————-
revision 1.3    locked by: root;
date: 2015/12/21 10:06:24;  author: root;  state: Exp;  lines: +3 -3
print staements removed
—————————-
revision 1.2
date: 2015/12/21 09:36:57;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
—————————-
revision 1.1
date: 2015/12/21 08:49:24;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: client5.c,v
Working file: client5.c
head: 1.2
branch:
locks: strict
root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2;    selected revisions: 2
description:
Client5 request for divide operation.
—————————-
revision 1.2    locked by: root;
date: 2015/12/21 10:06:27;  author: root;  state: Exp;  lines: +5 -5
print staements removed
—————————-
revision 1.1
date: 2015/12/21 09:05:44;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: divide.c,v
Working file: divide.c
head: 1.4
branch:
locks: strict
root: 1.4
access list:
symbolic names:
keyword substitution: kv
total revisions: 4;    selected revisions: 4
description:
It is used for accepting request for divide i.e when operation=’/’
—————————-
revision 1.4    locked by: root;
date: 2016/01/06 08:52:44;  author: root;  state: Exp;  lines: +1 -1
signal is removed.
—————————-
revision 1.3
date: 2016/01/01 02:08:20;  author: root;  state: Exp;  lines: +3 -2
alarm signal is send to server after it writes result to server
—————————-
revision 1.2
date: 2015/12/21 09:59:36;  author: root;  state: Exp;  lines: +1 -1
print statement decreased.
—————————-
revision 1.1
date: 2015/12/21 09:06:02;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: modulo.c,v
Working file: modulo.c
head: 1.5
branch:
locks: strict
root: 1.5
access list:
symbolic names:
keyword substitution: kv
total revisions: 5;    selected revisions: 5
description:
This gives result of modulo
—————————-
revision 1.5    locked by: root;
date: 2016/01/06 08:52:52;  author: root;  state: Exp;  lines: +1 -1
signal is removed.
—————————-
revision 1.4
date: 2016/01/01 02:08:33;  author: root;  state: Exp;  lines: +3 -2
alarm signal is send to server after it writes result to server
..
—————————-
revision 1.3
date: 2015/12/21 09:59:41;  author: root;  state: Exp;  lines: +1 -1
print statement decreased.
—————————-
revision 1.2
date: 2015/12/21 08:53:15;  author: root;  state: Exp;  lines: +1 -1
print statement changes.
—————————-
revision 1.1
date: 2015/12/21 08:49:48;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: multiplier.c,v
Working file: multiplier.c
head: 1.4
branch:
locks: strict
root: 1.4
access list:
symbolic names:
keyword substitution: kv
total revisions: 4;    selected revisions: 4
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.4    locked by: root;
date: 2016/01/06 08:52:59;  author: root;  state: Exp;  lines: +1 -1
signal is received.
—————————-
revision 1.3
date: 2016/01/01 02:08:39;  author: root;  state: Exp;  lines: +2 -1
alarm signal is send to server after it writes result to server
—————————-
revision 1.2
date: 2015/12/21 09:59:45;  author: root;  state: Exp;  lines: +1 -1
print statement decreased.
—————————-
revision 1.1
date: 2015/12/21 04:46:24;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: server.c,v
Working file: server.c
head: 1.46
branch:
locks: strict
root: 1.46
access list:
symbolic names:
keyword substitution: kv
total revisions: 46;    selected revisions: 46
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.46    locked by: root;
date: 2016/01/06 10:22:21;  author: root;  state: Exp;  lines: +0 -10
*** empty log message ***
—————————-
revision 1.45
date: 2016/01/06 09:13:03;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.44
date: 2016/01/06 08:53:09;  author: root;  state: Exp;  lines: +3 -3
signal is removed.
wait() is used instead of pause().
—————————-
revision 1.43
date: 2016/01/04 11:04:33;  author: root;  state: Exp;  lines: +1 -0
rfd and wfd are printed.
—————————-
revision 1.42
date: 2016/01/04 11:00:31;  author: root;  state: Exp;  lines: +2 -0
The pipe fd’s are closed.
—————————-
revision 1.41
date: 2016/01/04 10:41:42;  author: root;  state: Exp;  lines: +1 -0
Print statement added to show which no. of cient is accessing th server.
—————————-
revision 1.40
date: 2016/01/04 03:32:19;  author: root;  state: Exp;  lines: +1 -1
No, of clients determination corrected.
—————————-
revision 1.39
date: 2016/01/04 03:11:11;  author: root;  state: Exp;  lines: +1 -0
No.of clients Printed.
—————————-
revision 1.38
date: 2016/01/04 03:05:30;  author: root;  state: Exp;  lines: +4 -4
2nd argument of read or write corrected.
—————————-
revision 1.37
date: 2016/01/04 03:03:31;  author: root;  state: Exp;  lines: +28 -28
array of variables changed to simple variables
—————————-
revision 1.36
date: 2016/01/04 02:54:37;  author: root;  state: Exp;  lines: +2 -3
*** empty log message ***
—————————-
revision 1.35
date: 2016/01/04 02:52:44;  author: root;  state: Exp;  lines: +2 -1
*** empty log message ***
—————————-
revision 1.34
date: 2016/01/04 02:46:38;  author: root;  state: Exp;  lines: +2 -6
close() command is removed.
—————————-
revision 1.33
date: 2016/01/04 02:43:10;  author: root;  state: Exp;  lines: +2 -1
*** empty log message ***
—————————-
revision 1.32
date: 2016/01/04 02:37:50;  author: root;  state: Exp;  lines: +2 -3
*** empty log message ***
—————————-
revision 1.31
date: 2016/01/04 02:36:11;  author: root;  state: Exp;  lines: +6 -7
while is used instead of for loop.
—————————-
revision 1.30
date: 2016/01/01 02:12:09;  author: root;  state: Exp;  lines: +1 -1
ce
—————————-
revision 1.29
date: 2016/01/01 02:08:42;  author: root;  state: Exp;  lines: +12 -1
pause is used instead of wait() before reading result from pipe through calculating client.
—————————-
revision 1.28
date: 2015/12/21 10:10:28;  author: root;  state: Exp;  lines: +2 -2
print removed.
—————————-
revision 1.27
date: 2015/12/21 10:06:30;  author: root;  state: Exp;  lines: +5 -5
print staements removed
—————————-
revision 1.26
date: 2015/12/21 09:56:25;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.25
date: 2015/12/21 09:50:03;  author: root;  state: Exp;  lines: +2 -2
Print statement corrected.
—————————-
revision 1.24
date: 2015/12/21 09:41:27;  author: root;  state: Exp;  lines: +1 -0
sleep is replaced by wait()
—————————-
revision 1.23
date: 2015/12/21 09:38:51;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.22
date: 2015/12/21 09:36:59;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.21
date: 2015/12/21 09:07:13;  author: root;  state: Exp;  lines: +4 -0
divide is also included in operations.
—————————-
revision 1.20
date: 2015/12/21 08:50:02;  author: root;  state: Exp;  lines: +4 -0
modulo choice is added to switch(req.opr)
—————————-
revision 1.19
date: 2015/12/21 08:26:26;  author: root;  state: Exp;  lines: +1 -1
loop is executing one more time.
—————————-
revision 1.18
date: 2015/12/21 08:21:43;  author: root;  state: Exp;  lines: +1 -1
ce
—————————-
revision 1.17
date: 2015/12/21 08:19:40;  author: root;  state: Exp;  lines: +3 -3
Print statement before writion for calculation added.
—————————-
revision 1.16
date: 2015/12/21 08:11:55;  author: root;  state: Exp;  lines: +1 -1
ce
—————————-
revision 1.15
date: 2015/12/21 08:10:57;  author: root;  state: Exp;  lines: +6 -6
Changes in addresses in read and write statements.
—————————-
revision 1.14
date: 2015/12/21 08:00:30;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
—————————-
revision 1.13
date: 2015/12/21 07:47:37;  author: root;  state: Exp;  lines: +2 -2
&(req+i) changes to (&req+i)
—————————-
revision 1.12
date: 2015/12/21 07:45:49;  author: root;  state: Exp;  lines: +16 -9
req change to req[i] for client i.
—————————-
revision 1.11
date: 2015/12/21 07:31:19;  author: root;  state: Exp;  lines: +14 -10
fd[i] changes to fd
—————————-
revision 1.10
date: 2015/12/21 07:12:56;  author: root;  state: Exp;  lines: +5 -5
res changes to res[MAX_SIZE]
—————————-
revision 1.9
date: 2015/12/21 07:07:57;  author: root;  state: Exp;  lines: +35 -35
fd become fd[MAX_CLIENT]
rfd[4] and wfd[4] becomes rfd[MAX_CLIENT][4] and wfd[MAX_CLIENT][4].
count changes to count[MAX_CLIENT]
—————————-
revision 1.8
date: 2015/12/21 06:58:49;  author: root;  state: Exp;  lines: +2 -2
sleep removed.
—————————-
revision 1.7
date: 2015/12/21 06:55:16;  author: root;  state: Exp;  lines: +2 -0
*** empty log message ***
—————————-
revision 1.6
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.11
branch:
locks: strict
root: 1.11
access list:
symbolic names:
keyword substitution: kv
total revisions: 11;    selected revisions: 11
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.11    locked by: root;
date: 2016/01/06 08:53:35;  author: root;  state: Exp;  lines: +2 -2
kill() is removed.
signal is not used.
—————————-
revision 1.10
date: 2016/01/04 10:56:49;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.9
date: 2016/01/04 10:56:16;  author: root;  state: Exp;  lines: +4 -3
*** empty log message ***
—————————-
revision 1.8
date: 2016/01/04 10:52:54;  author: root;  state: Exp;  lines: +2 -1
*** empty log message ***
—————————-
revision 1.7
date: 2016/01/04 10:51:58;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.6
date: 2016/01/04 10:51:23;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.5
date: 2016/01/04 10:50:54;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.4
date: 2016/01/04 10:47:34;  author: root;  state: Exp;  lines: +1 -1
exit function is used instead of return.
—————————-
revision 1.3
date: 2016/01/01 02:09:33;  author: root;  state: Exp;  lines: +3 -2
alarm signal is send to server after it writes result to server
—————————-
revision 1.2
date: 2015/12/21 09:59:50;  author: root;  state: Exp;  lines: +1 -1
print statement decreased.
—————————-
revision 1.1
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>