Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
2Activity
0 of .
Results for:
No results containing your search query
P. 1
Network Programming Lab Manual

Network Programming Lab Manual

Ratings: (0)|Views: 132|Likes:
Published by arjun_reddykmmits

More info:

Published by: arjun_reddykmmits on Jul 22, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

08/22/2011

pdf

text

original

 
 
Information Technology
1
KMM INSTITUTE OF TECHNOLOGY AND SCIENCE
 
(Affiliated to JNTUA, Approved by AICTE)
 
Ramireddy Palli, Tirupathi-507501 Chittoor
(Dist)
 
Network Programming Lab
Manual
 
Department of CSE/IT
Prepared By: K R Arjun Reddy
Asst. Professor
 
 JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITYANANTAPUR.
 
 
Information Technology
2
 JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY
ANANTAPUR
 
IV Year B.Tech. IT -I Sem T P C
 
0 3 2
 
NETWORK PROGRAMMING LAB
 
Objectives:
 
 
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 variable simultaneously 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 into upper case.
 Week12
 Design a RPC application to add and subtract a given pair of integers 
 
 
Information Technology
3
 Week1.
 Implement the following forms of IPC.a)
Pipe
s b) FIFOa) Named
Pipe
sHalf 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 amed-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);

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->