EmbLogic's Blog

Socket (AF_UNIX)

log file for server

head    1.2;
access;
symbols;
locks; strict;
comment    @ * @;

1.2
date    2013.12.29.09.42.09;    author root;    state Exp;
branches;
next    1.1;

1.1
date    2013.12.29.09.35.38;    author root;    state Exp;
branches;
next    ;

desc
@main server file for socket using AF_UNIX
@

1.2
log
@indent correction
———————————————————————————————————————————————–

log file for client

head    1.1;
access;
symbols;
locks; strict;
comment    @ * @;

1.1
date    2013.12.29.09.40.02;    author root;    state Exp;
branches;
next    ;

desc
@source code for client1 of socket AF_UNIX

Posted in Project 04: FTP based Client Server using Threads and Sockets | Tagged , | Leave a comment

socket implementation

this is server side:

head    ;
access;
symbols;
locks; strict;
comment    @ * @;

desc
@this is server side, which is reading a request from client and also writing data to client side
@

this is client side:

head    ;
access;
symbols;
locks; strict;
comment    @ * @;

desc
@this is client side which is sending data to server and recieving data from server
@

Posted in Uncategorized | Leave a comment

socket

head    ;
access;
symbols;
locks; strict;
comment @ * @;

desc
@this is the client implemented with socket.
@

Posted in Uncategorized | Leave a comment

socket

head    ;
access;
symbols;
locks; strict;
comment @ * @;

desc
@this is code of server which is implemented with the use of socket.
@
~
~

Posted in Uncategorized | Leave a comment

Socket client server.

Implemented socket client server program for AN_UNIX domain.

Log file for server:

head    1.2;
access;
symbols;
locks
root:1.2; strict;
comment    @ * @;

1.2
date    2013.12.29.08.15.37;    author root;    state Exp;
branches;
next    1.1;

1.1
date    2013.12.29.08.12.40;    author root;    state Exp;
branches;
next    ;

desc
@This is source code of socket server program.
@

1.2
log
@The errors in socket server are removed and the server works perfectly.
@

__________________________________________________________________

Log file for client:

head    1.2;
access;
symbols;
locks
root:1.2; strict;
comment    @ * @;

1.2
date    2013.12.29.08.15.01;    author root;    state Exp;
branches;
next    1.1;

1.1
date    2013.12.29.08.13.19;    author root;    state Exp;
branches;
next    ;

desc
@This is source code of socket client program.
@

1.2
log
@The errors are removed and the client works perfectly.
@

Posted in Uncategorized | Leave a comment

Implementing client server using threads

requesting client log file-

head    ;
access;
symbols;
locks; strict;
comment    @ * @;

desc
@this is requesting client and it is taking result through result fifo created by itself
@

server log file:

head    ;
access;
symbols;
locks; strict;
comment    @ * @;

desc
@this is server file and we use fifo with threads
@

Posted in Uncategorized | Leave a comment

Implemented IPC using threads and FIFo’s

requesting client log file-

head    ;
access;
symbols;
locks; strict;
comment    @ * @;

desc
@this is requesting client and it is taking result through result fifo created by itself
@

server log file:

head    ;
access;
symbols;
locks; strict;
comment    @ * @;

desc
@this is server file and we use fifo with threads
@

Posted in Uncategorized | Leave a comment

Threads in IPC.

Implemented the threads in Inter Process Communication. Individual thread create for each requesting client in server.

Log file for server:

head    1.2;
access;
symbols;
locks
root:1.2; strict;
comment    @ * @;

1.2
date    2013.12.28.11.57.21;    author root;    state Exp;
branches;
next    1.1;

1.1
date    2013.12.28.11.12.38;    author root;    state Exp;
branches;
next    ;

desc
@This is the source code file of server with thread created for each request.
@

1.2
log
@final source code after debugging.
@

Log file for requesting client:

head    1.2;
access;
symbols;
locks
root:1.2; strict;
comment    @ * @;

1.2
date    2013.12.28.12.01.54;    author root;    state Exp;
branches;
next    1.1;

1.1
date    2013.12.28.11.14.02;    author root;    state Exp;
branches;
next    ;

desc
@This is the source code file for requesting client for which the server create a thread.
@

1.2
log
@The source code for requesting client debugged.
@

Posted in Uncategorized | Leave a comment

Server – Client using Threads

Log file for server

head    1.1;
access;
symbols;
locks; strict;
comment    @ * @;

1.1
date    2013.12.28.07.56.32;    author emblogic;    state Exp;
branches;
next    ;

desc
@server with thread is created.
data from client to thread .
@

———————————————————————-

log file for request client

head    1.1;
access;
symbols;
locks
emblogic:1.1; strict;
comment    @ * @;

1.1
date    2013.12.28.07.58.32;    author emblogic;    state Exp;
branches;
next    ;

desc
@requesting client using semaphore and shared memory sucssecfully created.
@

 

———————————————————————————————————————————

log file for processing client

head    1.1;
access;
symbols;
locks
emblogic:1.1; strict;
comment    @ * @;

1.1
date    2013.12.28.07.58.43;    author emblogic;    state Exp;
branches;
next    ;

desc
@processing client using shared memory is created.
@

Posted in Project 04: FTP based Client Server using Threads and Sockets, Uncategorized | Tagged , | Leave a comment

implementation of IPC project with threads is completed

THE LOG FILE PROJECT IS:

head    1.1;
access;
symbols;
locks; strict;
comment    @ * @;

1.1
date    2013.12.28.07.56.32;    author emblogic;    state Exp;
branches;
next    ;

desc
@server with thread is created.
data from client to thread .
@

1.1
log
@Initial revision

head    1.1;
access;
symbols;
locks
emblogic:1.1; strict;
comment    @ * @;

1.1
date    2013.12.28.07.58.32;    author emblogic;    state Exp;
branches;
next    ;

desc
@requesting client using semaphore and shared memory sucssecfully created.
@

1.1

 

Posted in Uncategorized | Leave a comment

IPC Project completed with shared memory

here the log file the project.

 

head   1.2;

access;

symbols;

locks

deepak:1.2; strict;

comment       @ * @;

 

 

1.2

date    2013.12.26.20.55.33; author deepak;         state Exp;

branches;

next    1.1;

 

1.1

date    2013.12.26.19.24.38; author deepak;         state Exp;

branches;

next    ;

 

 

desc

@server is created .

data from client side is recieved.

@

 

 

1.2

log

@now new shared memory is craeted .

for server and processing client.

 

 

head   1.2;

access;

symbols;

locks

deepak:1.2; strict;

comment       @ * @;

 

 

1.2

date    2013.12.26.19.39.40; author deepak;         state Exp;

branches;

next    1.1;

 

1.1

date    2013.12.26.19.26.26; author deepak;         state Exp;

branches;

next    ;

 

 

desc

@client is created.

data send to server.

@

 

 

1.2

log

@removing bugs and warning.

@

text

head   1.1;

access;

symbols;

locks

deepak:1.1; strict;

comment       @ * @;

 

 

1.1

date    2013.12.26.20.39.24; author deepak;         state Exp;

branches;

next    ;

 

 

desc

@processing client is formed.

result is sent to server.

@

 

 

1.1

log

@Initial revision

@

Posted in Uncategorized | Leave a comment

IPC based project

Implemented client server Inter process communication using shared memory.

Posted in Uncategorized | Leave a comment

PROCESS MANAGEMENT

“Process management” as name itself means to manage the processes. And in terms of Linux OS, processes means “executing instance” of a program or we can use a word “tasks” for processes.

Example: when ever we copy a file or folder from one location to another in windows OS it usually displays  a graph , a moving file, time remaining, how much memory remaining etc. All such things are called processes. But you must have noticed one thing that actually these are different processes which runs under a same program.

so there is parent process and child process. The process which creates another process is called parent process and latter is called child process. And each process has its own PID i.e. process identity number to distinguish the child from the parent.

To get these process IDs in the program

The functions are

getpid() // to get the current process id

getppid() // to get the creator/ parent process id

There are three methods of creating a process:

1. Create a process with the use  of loader from file system.

2. Create a process from the code segment of the current program using system call

3. Duplication of the program

The easiest one is to use a Duplication of  a program

To create a process using this method is done by using “fork()”

fork function is a special function use to create a child process from a parent process. Using fork(), child process shares the code segment of its parent but both processes have different physical address. After completion of the child process, child process returns its control to parent and the parent process returns its control to the shell.

child PID= parent PID + 1

PPID of child = PID of parent

fork() returns three values and we can use these values to know which process  is executing

fork() returns following values

0 (zero)    :  if the process is executed by child

+ve value :  means child is created and +ve value is child’s PID

-ve value  :  ERROR…! i.e. child process is not created.

NOTE: child process and Parent process both are the part of same program and execute at the same time. It depends on the scheduler that which process executes in which order…….!

Rest i will surely update about how to manage these processes and i will add more stuff related to Process management ….soon…!

Posted in Uncategorized | Leave a comment

Completed—- Client-Server IPC using Message Queues.

Log File For Server:

head    1.2;
access;
symbols;
locks
root:1.2; strict;
comment    @ * @;

1.2
date    2013.12.24.10.09.27;    author root;    state Exp;
branches;
next    1.1;

1.1
date    2013.12.24.09.32.25;    author root;    state Exp;
branches;
next    ;

desc
@This is the main server source file for client server project using message queue.
@

1.2
log
@This is the final source code of server.
change the value of msg_id of msg_st.
————————————————————————————————

Log File For Req_add
head    1.1;
access;
symbols;
locks
root:1.1; strict;
comment    @ * @;

1.1
date    2013.12.24.09.38.26;    author root;    state Exp;
branches;
next    ;

desc
@This is the request client for addition.
@

1.1
log
@Initial revision

 

—————————————————————————————-

Log file for Req_sub

head    1.1;
access;
symbols;
locks
root:1.1; strict;
comment    @ * @;

1.1
date    2013.12.24.10.06.30;    author root;    state Exp;
branches;
next    ;

desc
@This is the source code of requesting client for substration.
@

1.1
log
@Initial revision

 

—————————————————————————————-

log file for Req_Mul

head    1.1;
access;
symbols;
locks
root:1.1; strict;
comment    @ * @;

1.1
date    2013.12.24.10.07.13;    author root;    state Exp;
branches;
next    ;

desc
@This is source code of requesting client for multiplication.
@

1.1
log
@Initial revision

—————————————————————————————

Log file For Proccesing_Add

head    1.1;
access;
symbols;
locks
root:1.1; strict;
comment    @ * @;

1.1
date    2013.12.24.09.54.10;    author root;    state Exp;
branches;
next    ;

desc
@This is the source code of processing client for addition.
@

1.1
log
@Initial revision

—————————————————————————————

Log file For Proccesing_Sub

head    1.1;
access;
symbols;
locks
root:1.1; strict;
comment    @ * @;

1.1
date    2013.12.24.10.08.22;    author root;    state Exp;
branches;
next    ;

desc
@This is source code of processing client for substraction.
@

1.1
log
@Initial revision

—————————————————————————————

Log file For Proccesing_Mul

head    1.1;
access;
symbols;
locks
root:1.1; strict;
comment    @ * @;

1.1
date    2013.12.24.10.09.14;    author root;    state Exp;
branches;
next    ;

desc
@This is source code of processing client for multiplcation.
@

1.1
log
@Initial revision

Posted in Uncategorized | Leave a comment

IPC using message queues

Log File For Server:

head    1.2;
access;
symbols;
locks
root:1.2; strict;
comment    @ * @;

1.2
date    2013.12.24.10.09.27;    author root;    state Exp;
branches;
next    1.1;

1.1
date    2013.12.24.09.32.25;    author root;    state Exp;
branches;
next    ;

desc
@This is the main server source file for client server project using message queue.
@

1.2
log
@This is the final source code of server.
change the value of msg_id of msg_st.
————————————————————————————————

Log File For Req_add
head    1.1;
access;
symbols;
locks
root:1.1; strict;
comment    @ * @;

1.1
date    2013.12.24.09.38.26;    author root;    state Exp;
branches;
next    ;

desc
@This is the request client for addition.
@

1.1
log
@Initial revision

 

—————————————————————————————-

Log file for Req_sub

head    1.1;
access;
symbols;
locks
root:1.1; strict;
comment    @ * @;

1.1
date    2013.12.24.10.06.30;    author root;    state Exp;
branches;
next    ;

desc
@This is the source code of requesting client for substration.
@

1.1
log
@Initial revision

 

—————————————————————————————-

log file for Req_Mul

head    1.1;
access;
symbols;
locks
root:1.1; strict;
comment    @ * @;

1.1
date    2013.12.24.10.07.13;    author root;    state Exp;
branches;
next    ;

desc
@This is source code of requesting client for multiplication.
@

1.1
log
@Initial revision

—————————————————————————————

Log file For Proccesing_Add

head    1.1;
access;
symbols;
locks
root:1.1; strict;
comment    @ * @;

1.1
date    2013.12.24.09.54.10;    author root;    state Exp;
branches;
next    ;

desc
@This is the source code of processing client for addition.
@

1.1
log
@Initial revision

—————————————————————————————

Log file For Proccesing_Sub

head    1.1;
access;
symbols;
locks
root:1.1; strict;
comment    @ * @;

1.1
date    2013.12.24.10.08.22;    author root;    state Exp;
branches;
next    ;

desc
@This is source code of processing client for substraction.
@

1.1
log
@Initial revision

—————————————————————————————

Log file For Proccesing_Mul

head    1.1;
access;
symbols;
locks
root:1.1; strict;
comment    @ * @;

1.1
date    2013.12.24.10.09.14;    author root;    state Exp;
branches;
next    ;

desc
@This is source code of processing client for multiplcation.
@

1.1
log
@Initial revision

Posted in Project 03: Client Server Communication using Linux and IPC | Leave a comment