EmbLogic's Blog

Category Archives: Project 03: Client Server Communication using Linux and IPC

We need to creat an Inter Process Communication based Client-Server setup. There should be a Server program, Some clients would send requests to the server and the server would further find the appropriate client to process the request. The server then invokes the new client so as to process the request. The new client should then rend the result back to the server , which then sends it forward to the requesting client.

IPC based server-client based project using shared memory with semaphore and signal(SIGUSR1)

OUTPUT AT SERVER TERMINAL [root@VIPIN scp_shm_usingsemp]# ./server semget: Success process 8390 create the semaphore semctl: Success process 8390 control the semaphore address of val in server0x804914c shmget: Success process 8390 create the shared mem process 8390 control the shared mem … Continue reading

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

IPC based server-client project using message queue with semaphore

OUTPUT AT SERVER TERMINAL [root@VIPIN scp_mq_using_semp]# ./server semget:: Success msgget:: Success msgctl:: Success msgrcv at server: Success 1 2 + data send to pc1 from server: Success msgget:: Success data recieved from server at pc1: Success result send to server … Continue reading

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

Basic implementation of Semaphore

RCS file: ./1sem.c,v Working file: ./1sem.c head: 1.7 branch: locks: strict root: 1.7 access list: symbolic names: keyword substitution: kv total revisions: 7; selected revisions: 7 description: implementation of basic semaphore —————————- revision 1.7 locked by: root; date: 2014/11/22 04:22:47; … Continue reading

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

Basic implementation of signal in IPC

RCS file: ./1sig.c,v Working file: ./1sig.c head: 1.2 branch: locks: strict root: 1.2 access list: symbolic names: keyword substitution: kv total revisions: 2; selected revisions: 2 description: basic implementation of signals —————————- revision 1.2 locked by: root; date: 2014/11/22 04:18:02; … Continue reading

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

IPC based server-client project using fifo

RCS file: server.c,v Working file: server.c head: 1.47 branch: locks: strict root: 1.47 access list: symbolic names: keyword substitution: kv total revisions: 47; selected revisions: 47 description: SERVER —————————- revision 1.47 locked by: root; date: 2014/11/11 03:55:47; author: root; state: … Continue reading

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

IPC based project using threads

RCS for sever file RCS file: server.c,v Working file: server.c head: 1.34 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 34; selected revisions: 34 description: server program using threads —————————- revision 1.34 date: 2014/11/21 06:58:33; author: … Continue reading

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

IPC based server-client project using message queue

Header file RCS for IPC project using message queue: RCS file: ./header.h,v Working file: ./header.h head: 1.4 branch: locks: strict root: 1.4 access list: symbolic names: keyword substitution: kv total revisions: 4; selected revisions: 4 description: header file for client … Continue reading

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

client-server communication using PIPES

server.c: #include”header1.h” int main() { pid_t pid_c,pid_p; int fd_c[2],fd_p[2],counter=0,pipec_success,pipep_success,stat_val,res; char fd_cr[2],fd_cw[2],fd_pr[2],fd_pw[2],*path; struct data_format data; path = malloc(sizeof(char)*50); while(counter < 3) { pipec_success = pipe(fd_c); if(pipec_success != 0) { perror(“Pipe client:”); return -1; } sprintf(fd_cr,”%d”,fd_c[0]); sprintf(fd_cw,”%d”,fd_c[1]); printf(“Enter path\n”); gets(path); pid_c = … Continue reading

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

message queue

Message queue is the inter process technique in which two or more unrelated process can communicate using that queue. In message queue we send a message number associated with particular client/process along with our data and at the server end … Continue reading

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

Program to pass file descriptor from one process to another

Output of the program is: Main function starts File opened successfully with fd 3 i am in parent I am in child process and my pid is 1505 fd received from calling process is 3 file contains Welcome to emblogic. … Continue reading

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

IPC client-server project using pipes only.

Output is: [root@VIPIN server_client_comm4.1]# ./server Requesting client1 has written 12 bytes of data on server Processing client1 has recieved 12 bytes of data from server The recieved data is a=7 b=4 operator=+ Result calculated by the processing client1 is 11 … Continue reading

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

Pipes Implementation…..

CS file: ./1pipes.c,v Working file: ./1pipes.c head: 1.3 branch: locks: strict root: 1.3 access list: symbolic names: keyword substitution: kv total revisions: 3; selected revisions: 3 description: Basic implementation of pipes —————————- revision 1.3 locked by: root; date: 2014/10/16 18:44:25; … Continue reading

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

Process management(Replacing process using fork and execl)

RCS file: ./1execl.c,v Working file: ./1execl.c head: 1.3 branch: locks: strict root: 1.3 access list: symbolic names: keyword substitution: kv total revisions: 3; selected revisions: 3 description: basic implementation of process replacement —————————- revision 1.3 locked by: root; date: 2014/10/15 … Continue reading

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

Process management(Duplicating process image using fork system call)

RCS file: ./2fork.c,v Working file: ./2fork.c head: 1.2 branch: locks: strict root: 1.2 access list: symbolic names: keyword substitution: kv total revisions: 2; selected revisions: 2 description: basic fork implementation —————————- revision 1.2 locked by: root; date: 2014/10/14 21:23:34; author: … Continue reading

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

Client,server and process communication project using signals

Welcome to the Project!! n1=12, n2=23 Performing addition action In Server:Sum=35 In CLIENT: Result=35 n1=20, n2=8 Performing Subtraction action In Server:Sub=12 In CLIENT2: Result=12 n1=5, n2=8 Performing Multiplication action In Server:Mul=40 In CLIENT3: Result=40 RCS file: RCS/server.c,v Working file: server.c … Continue reading

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