Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to write the program on full-duplex communication on
biderctional(e.g using two pipes)

Answer Posted / karthik chowdary

#include<stdio.h>
main()
{
int p1[2],p2[2],a;
char *msg1="hai";
char *msg2="infosys";
char *buff[7];
a=fork();
pipe[p1];
pipe[p2];
if(a==0)
{
write(p1[1],msg1,7);
sleep(5);
read(p2[0],buff,7);
printf("%s",buff);
}
else
{
read(p1[0],buff,7);
printf("%s",buff);
write(p2[1],msg2,7);
}
}

Is This Answer Correct ?    16 Yes 17 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the full form of ipc?

1185


What is ipc in unix?

1059


Please describe the initial process sequence while the system boots up?

1074


Explain how do you execute one program from within another?

1019


Tell me set-user-id is related to (in unix)?

961


Explain linking across directories?

1009


What is the very first process created by kernel?

1106


Explain what is the process id for kernel process?

1040


What are the various schemes available in ipc?

1030


Max relax-able permission value with out giving write permission to others?

1073


Explain the system calls used for process management?

1025


Explain the initial process sequence while the system boots up?

1015


Explain the advantage of executing a process in background?

978


What is daemon?

1085


What are the various schemes available?

1006