EmbLogic's Blog

Code for a client/server application that uses AF_UNIX address family for local sockets.

RCS file: simple_c_s_app.c,v
Working file: simple_c_s_app.c
head: 1.10
branch:
locks: strict
root: 1.10
access list:
symbolic names:
keyword substitution: kv
total revisions: 10;    selected revisions: 10
description:
A simple client/server application in which a server waits for client requests.
—————————-
revision 1.10    locked by: root;
date: 2014/01/30 16:43:52;  author: root;  state: Exp;  lines: +9 -0
unlink() system call is used to delete any old socket with name “socket”.
accept() system call is used to accept a connection.The accept() will block indefinitely waiting for incoming requests to arrive.
The program is running as per expectations.
—————————-
revision 1.9
date: 2014/01/30 16:33:04;  author: root;  state: Exp;  lines: +1 -0
A socket is created with name “socket”.
Preciously it was not getting created because its name is not given sun_path and the length of the address
structure is also not given.Now the socket is getting created.
—————————-
revision 1.8
date: 2014/01/30 16:29:33;  author: root;  state: Exp;  lines: +3 -0
Header file:<string.h> is included to support strcpy() function.
—————————-
revision 1.7
date: 2014/01/30 16:02:36;  author: root;  state: Exp;  lines: +7 -0
A socket queue of 5 is created using listen system call.
A message will be displayed if the socket queue creation failed.
—————————-
revision 1.6
date: 2014/01/30 15:54:15;  author: root;  state: Exp;  lines: +1 -0
Header file:<sys/un.h> is added to include a structure describing the address of AF_UNIX socket.
—————————-
revision 1.5
date: 2014/01/30 15:50:35;  author: root;  state: Exp;  lines: +2 -0
Header file:<sys/types.h> and <sys/socket.h> is included to support bind() and socket() functions.
—————————-
revision 1.4
date: 2014/01/30 15:47:41;  author: root;  state: Exp;  lines: +10 -1
bind() system call is used to make the socket created by using socket() system call to be available to others.
A message will be displayed if the naming failed.
—————————-
revision 1.3
date: 2014/01/30 15:37:45;  author: root;  state: Exp;  lines: +1 -0
Header file:<stdlib.h> is included to support exit() function.
,
—————————-
revision 1.2
date: 2014/01/30 15:34:31;  author: root;  state: Exp;  lines: +11 -1
A socket is created using socket() system call and a message is displayed if the socket creation failed.
—————————-
revision 1.1
date: 2014/01/30 15:30:01;  author: root;  state: Exp;
Initial revision
=============================================================================
RCS file: client.c,v
Working file: client.c
head: 1.3
branch:
locks: strict
root: 1.3
access list:
symbolic names:
keyword substitution: kv
total revisions: 3;    selected revisions: 3
description:
Client program that sends a requests to server.
socket() system call is used to create a socket and display an error message if there is any issue.
—————————-
revision 1.3    locked by: root;
date: 2014/01/30 17:09:47;  author: root;  state: Exp;  lines: +4 -0
Header files:<sys/un.h>,<sys/types.h> and <sys/socket.h> is included.
—————————-
revision 1.2
date: 2014/01/30 17:07:49;  author: root;  state: Exp;  lines: +11 -1
connect() system call is used to send a request to the server.
A message will be displayed if there is an error.
Checking,,,,.
—————————-
revision 1.1
date: 2014/01/30 16:56:32;  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>