Read without ads and support Scribd by becoming a Scribd Premium Reader.
 
 
1
ADAM’S ENGINEERING COLLEGE
(Affiliated to JNTUH, Approved by AICTE & Accredited by NBA)
Seetarampatnam, Paloncha-507115 Khammam (Dist)
Network Programming Lab Manual
Department of Computer Science & Engineering
Prepared By:G.Sampath Kumar.
M.Tech, M.I.S.T.E, M.C.S.I.
Asst. Professor
 JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITYHYDERABAD.
 
 
2
 JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITYHYDERABADIV Year B.Tech. CSE -I Sem T P C0 3 2NETWORK PROGRAMMING LABObjectives:
 
To teach students various forms of IPC through Unix and socket Programming
Recommended Systems/Software Requirements:
 
Intel based desktop PC with minimum of 166 MHZ or faster processor with at least 64 MB RAM and100 MB free disk space LAN Connected
 
Any flavor of Unix / Linux
Week1.
Implement the following forms of IPC.a)Pipesb)FIFO
Week2.
Implement file transfer using Message Queue form of IPC
Week3.
Write a program to create an integer variable using shared memory concept and increment the variablesimultaneously by two processes. Use semaphores to avoid race conditions
Week4.
Design TCP iterative Client and server application to reverse the given input sentence
Week5.
Design TCP iterative Client and server application to reverse the given input sentence
Week6.
Design TCP client and server application to transfer file
Week7.
Design a TCP concurrent server to convert a given text into upper case using multiplexing system call “select”
Week8.
Design a TCP concurrent server to echo given set of sentences using poll functions
Week9.
Design UDP Client and server application to reverse the given input sentence
Week10
Design UDP Client server to transfer a file
Week11
Design using poll client server application to multiplex TCP and UDP requests for converting a given text intoupper case.
Week12
Design a RPC application to add and subtract a given pair of integers
Reference Book:
1. Advance UNIX Programming Richard Stevens, Second Edition Pearson Education2. Advance UNIX Programming, N.B. Venkateswarlu, BS Publication.
 
 
3
Week1.
Implement the following forms of IPC.a) Pipes b) FIFOa)
 
Named PipesHalf Duplex---------------------------------------------------------------------------------------------------------------------
half Duplex.h
#define HALF_DUPLEX "/tmp/halfduplex"#define MAX_BUF_SIZE 255---------------------------------------------------------------------------------------------------------------------
hd_server.c
#include <stdio.h>#include <errno.h>#include <ctype.h>#include <unistd.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include "half_duplex.h" /* For name of the named-pipe */#include <stdlib.h>int main(int argc, char *argv[]){int fd, ret_val, count, numread;char buf[MAX_BUF_SIZE];/* Create the named - pipe */ret_val = mkfifo(HALF_DUPLEX, 0666);if ((ret_val == -1) && (errno != EEXIST)) {perror("Error creating the named pipe\n");exit (1);}/* Open the pipe for reading */fd = open(HALF_DUPLEX, O_RDONLY);/* Read from the pipe */numread = read(fd, buf, MAX_BUF_SIZE);
Search History:
Searching...
Result 00 of 00
00 results for result for
  • p.
  • Notes
    Load more