Download File
Download File Download File
Subject: NETWORK PROGRAMMING LAB Year : 2010 Class : IV B-Tech C.S.E Semester: First Aim: Implement the FIFO form of IPC /* file name makefifo.c */ # include # include # include # include int main() { int fd; char buff[100]; /*creating FIFO */ if((mkfifo("./MyFifo",S_IFIFO|S_IRWXU|S_IRWXG|S_IRWXO))0) printf("%s",buff); /*creating write process */ fd=open("./MyFifo",O_WRONLY); write(fd,"Hello world",12); close(fd); } /* Compiling…………. $ cc makefifo.c – o makefifo Execution………….. $ makefifo */ NP Lab Manual , RNEC page: 10
Output: [student@localhost ~/khan]$ vi makefifo.c [student@localhost ~/khan]$ cc makefifo.c -o makefifo [student@localhost ~/khan]$ ./makefifo [student@localhost ~/khan]$ ./makefifo mkfifo error...: File exists NP Lab Manual , RNEC page: 11
- Page 1 and 2: IV YEAR B.Tech Network Programming
- Page 3 and 4: o after call to fork o after both c
- Page 5 and 6: WEEK 1: Aim: Implement the pipe usi
- Page 7 and 8: Subject: NETWORK PROGRAMMING LAB Ye
- Page 9: Output: [student@localhost ~]$ vi p
- Page 13 and 14: } fclose(f); //closing file //creat
- Page 15 and 16: Subject: NETWORK PROGRAMMING LAB Ye
- Page 17 and 18: Output: [student@localhost ~]$ cc m
- Page 19 and 20: main() { int shmid; int semid; key_
- Page 21 and 22: } for (i = 0; i < CHILD_INCREMENT_C
- Page 23 and 24: if (*parent_shm == (CHILD_INCREMENT
- Page 25 and 26: Subject: NETWORK PROGRAMMING LAB Ye
- Page 27 and 28: Output: [student@localhost ~]$ cc t
- Page 29 and 30: Output: [student@localhost ~]$ ./ t
- Page 31 and 32: } bzero(&servaddr, sizeof(servaddr)
- Page 33 and 34: Subject: NETWORK PROGRAMMING LAB Ye
- Page 35 and 36: Subject: NETWORK PROGRAMMING LAB Ye
- Page 37 and 38: Output: [student@localhost ~]$ cc t
- Page 39 and 40: Output: [student@localhost ~]$ cc t
- Page 41 and 42: servAddr.sin_addr.s_addr = htonl(IN
- Page 43 and 44: Output: [student@localhost ~]$ cc u
- Page 45 and 46: *error = 0; return FD_ISSET(sd,&soc
- Page 47 and 48: if(n
- Page 49 and 50: Subject: NETWORK PROGRAMMING LAB Ye
- Page 51 and 52: printf("%s: from %s:UDP%u : %s \n"
- Page 53 and 54: Subject: NETWORK PROGRAMMING LAB Ye
- Page 55 and 56: cliAddr.sin_family = AF_INET; cliAd
- Page 57 and 58: Output: [student@localhost ~]$ cc u
- Page 59 and 60: if(rc
Subject: NETWORK PROGRAMMING LAB Year : 2010<br />
Class : IV B-Tech C.S.E Semester: First<br />
Aim: Implement the FIFO form of IPC /* file name makefifo.c */<br />
# include <br />
# include <br />
# include <br />
# include <br />
int main()<br />
{<br />
int fd;<br />
char buff[100];<br />
/*creating FIFO */<br />
if((mkfifo("./MyFifo",S_IFIFO|S_IRWXU|S_IRWXG|S_IRWXO))0)<br />
printf("%s",buff);<br />
/*creating write process */<br />
fd=open("./MyFifo",O_WRONLY);<br />
write(fd,"Hello world",12);<br />
close(fd);<br />
}<br />
/*<br />
Compiling………….<br />
$ cc makefifo.c – o makefifo<br />
Execution…………..<br />
$ makefifo<br />
*/<br />
NP Lab Manual , RNEC page: 10