SlideShare a Scribd company logo
Hello,
Ther is some problem in you code
I made my own programme as per your requirement
Please check my solution :-
1)Create one FIFO
2)From Client write character first and wait for some time so that server will read it
3) After wait for some time write integer
Server programme :-
---------------------------------------
#include
#include
#include
#include
#include
int main()
{
int client_to_server;
char *myfifo = "/tmp/client_to_server_fifo";
char str;
int iteration;
/* create the FIFO (named pipe) */
mkfifo(myfifo, 0666);
/* open, read, and display the message from the FIFO */
client_to_server = open(myfifo, O_RDONLY);
printf("Server ON. ");
read(client_to_server, &str, sizeof(str));
read(client_to_server, &iteration, sizeof(iteration));
close(client_to_server);
unlink(myfifo);
//Now Print the character
for(int i = 0; i < iteration ; i++){
printf("Iteration ::%d and Character:: %c ",i,str);
}
return 0;
}
Client Programme :-
---------------------------------------
#include
#include
#include
#include
#include
int main()
{
int client_to_server;
char *myfifo = "/tmp/client_to_server_fifo";
char str;
int iteration;
printf("Client: Please enter a character: ");
scanf("%c", &str);
printf("Client: Please enter an integer: ");
scanf("%d", &iteration);
/* write str to the FIFO */
client_to_server = open(myfifo, O_WRONLY);
//First write character
write(client_to_server, &str, sizeof(str));
//wait for some time so that server will read character
sleep(0.250);
//Then write integer
write(client_to_server, &iteration, sizeof(iteration));
perror("Write:"); //Very crude error check
printf("...received from the server: %s ",str);
close(client_to_server);
/* remove the FIFO */
return 0;
}
Solution
Hello,
Ther is some problem in you code
I made my own programme as per your requirement
Please check my solution :-
1)Create one FIFO
2)From Client write character first and wait for some time so that server will read it
3) After wait for some time write integer
Server programme :-
---------------------------------------
#include
#include
#include
#include
#include
int main()
{
int client_to_server;
char *myfifo = "/tmp/client_to_server_fifo";
char str;
int iteration;
/* create the FIFO (named pipe) */
mkfifo(myfifo, 0666);
/* open, read, and display the message from the FIFO */
client_to_server = open(myfifo, O_RDONLY);
printf("Server ON. ");
read(client_to_server, &str, sizeof(str));
read(client_to_server, &iteration, sizeof(iteration));
close(client_to_server);
unlink(myfifo);
//Now Print the character
for(int i = 0; i < iteration ; i++){
printf("Iteration ::%d and Character:: %c ",i,str);
}
return 0;
}
Client Programme :-
---------------------------------------
#include
#include
#include
#include
#include
int main()
{
int client_to_server;
char *myfifo = "/tmp/client_to_server_fifo";
char str;
int iteration;
printf("Client: Please enter a character: ");
scanf("%c", &str);
printf("Client: Please enter an integer: ");
scanf("%d", &iteration);
/* write str to the FIFO */
client_to_server = open(myfifo, O_WRONLY);
//First write character
write(client_to_server, &str, sizeof(str));
//wait for some time so that server will read character
sleep(0.250);
//Then write integer
write(client_to_server, &iteration, sizeof(iteration));
perror("Write:"); //Very crude error check
printf("...received from the server: %s ",str);
close(client_to_server);
/* remove the FIFO */
return 0;
}

More Related Content

Similar to Hello,Ther is some problem in you codeI made my own programme as.pdf

Fortran compiling 2
Fortran compiling 2Fortran compiling 2
Fortran compiling 2
najenssr
 
Finding 0days at Arab Security Conference
Finding 0days at Arab Security ConferenceFinding 0days at Arab Security Conference
Finding 0days at Arab Security Conference
Rodolpho Concurde
 
E yantra robot abstractions
E yantra robot abstractionsE yantra robot abstractions
E yantra robot abstractionsAkshar Desai
 
CODE FOR echo_client.c A simple echo client using TCP #inc.pdf
CODE FOR echo_client.c A simple echo client using TCP  #inc.pdfCODE FOR echo_client.c A simple echo client using TCP  #inc.pdf
CODE FOR echo_client.c A simple echo client using TCP #inc.pdf
secunderbadtirumalgi
 
Reverse engineering – debugging fundamentals
Reverse engineering – debugging fundamentalsReverse engineering – debugging fundamentals
Reverse engineering – debugging fundamentals
Eran Goldstein
 
#1 How to develop a VoIP softphone in C# by using Ozeki VoIP SIP SDK - Part 1
#1 How to develop a VoIP softphone in C# by using Ozeki VoIP SIP SDK - Part 1#1 How to develop a VoIP softphone in C# by using Ozeki VoIP SIP SDK - Part 1
#1 How to develop a VoIP softphone in C# by using Ozeki VoIP SIP SDK - Part 1
Ozeki Informatics Ltd.
 
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
Vincenzo Iozzo
 
1. Java Basic.pdf aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1. Java Basic.pdf aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1. Java Basic.pdf aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1. Java Basic.pdf aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
AnhKhoaTrng1
 
stackconf 2021 | Fuzzing: Finding Your Own Bugs and 0days!
stackconf 2021 | Fuzzing: Finding Your Own Bugs and 0days!stackconf 2021 | Fuzzing: Finding Your Own Bugs and 0days!
stackconf 2021 | Fuzzing: Finding Your Own Bugs and 0days!
NETWAYS
 
3.1.c apend scripting, crond, atd
3.1.c apend   scripting, crond, atd3.1.c apend   scripting, crond, atd
3.1.c apend scripting, crond, atd
Acácio Oliveira
 
Lab
LabLab
FMS Administration Seminar
FMS Administration SeminarFMS Administration Seminar
FMS Administration Seminar
Yoss Cohen
 
VoIP - Cisco CME &amp; IP Communicator
VoIP - Cisco CME &amp; IP CommunicatorVoIP - Cisco CME &amp; IP Communicator
VoIP - Cisco CME &amp; IP Communicatorchinmaypadhye1985
 
Linux kernel debugging
Linux kernel debuggingLinux kernel debugging
Linux kernel debugging
Hao-Ran Liu
 
Introduction of Pharo 5.0
Introduction of Pharo 5.0Introduction of Pharo 5.0
Introduction of Pharo 5.0
Masashi Umezawa
 
Router and switch basics configuration
Router and switch basics configurationRouter and switch basics configuration
Router and switch basics configuration
Missangae
 
Dive into exploit development
Dive into exploit developmentDive into exploit development
Dive into exploit development
Payampardaz
 
101 apend. scripting, crond, atd
101 apend. scripting, crond, atd101 apend. scripting, crond, atd
101 apend. scripting, crond, atd
Acácio Oliveira
 

Similar to Hello,Ther is some problem in you codeI made my own programme as.pdf (20)

FIFOPt
FIFOPtFIFOPt
FIFOPt
 
Fortran compiling 2
Fortran compiling 2Fortran compiling 2
Fortran compiling 2
 
Finding 0days at Arab Security Conference
Finding 0days at Arab Security ConferenceFinding 0days at Arab Security Conference
Finding 0days at Arab Security Conference
 
E yantra robot abstractions
E yantra robot abstractionsE yantra robot abstractions
E yantra robot abstractions
 
CODE FOR echo_client.c A simple echo client using TCP #inc.pdf
CODE FOR echo_client.c A simple echo client using TCP  #inc.pdfCODE FOR echo_client.c A simple echo client using TCP  #inc.pdf
CODE FOR echo_client.c A simple echo client using TCP #inc.pdf
 
Reverse engineering – debugging fundamentals
Reverse engineering – debugging fundamentalsReverse engineering – debugging fundamentals
Reverse engineering – debugging fundamentals
 
#1 How to develop a VoIP softphone in C# by using Ozeki VoIP SIP SDK - Part 1
#1 How to develop a VoIP softphone in C# by using Ozeki VoIP SIP SDK - Part 1#1 How to develop a VoIP softphone in C# by using Ozeki VoIP SIP SDK - Part 1
#1 How to develop a VoIP softphone in C# by using Ozeki VoIP SIP SDK - Part 1
 
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
 
Lecture9
Lecture9Lecture9
Lecture9
 
1. Java Basic.pdf aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1. Java Basic.pdf aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1. Java Basic.pdf aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1. Java Basic.pdf aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
stackconf 2021 | Fuzzing: Finding Your Own Bugs and 0days!
stackconf 2021 | Fuzzing: Finding Your Own Bugs and 0days!stackconf 2021 | Fuzzing: Finding Your Own Bugs and 0days!
stackconf 2021 | Fuzzing: Finding Your Own Bugs and 0days!
 
3.1.c apend scripting, crond, atd
3.1.c apend   scripting, crond, atd3.1.c apend   scripting, crond, atd
3.1.c apend scripting, crond, atd
 
Lab
LabLab
Lab
 
FMS Administration Seminar
FMS Administration SeminarFMS Administration Seminar
FMS Administration Seminar
 
VoIP - Cisco CME &amp; IP Communicator
VoIP - Cisco CME &amp; IP CommunicatorVoIP - Cisco CME &amp; IP Communicator
VoIP - Cisco CME &amp; IP Communicator
 
Linux kernel debugging
Linux kernel debuggingLinux kernel debugging
Linux kernel debugging
 
Introduction of Pharo 5.0
Introduction of Pharo 5.0Introduction of Pharo 5.0
Introduction of Pharo 5.0
 
Router and switch basics configuration
Router and switch basics configurationRouter and switch basics configuration
Router and switch basics configuration
 
Dive into exploit development
Dive into exploit developmentDive into exploit development
Dive into exploit development
 
101 apend. scripting, crond, atd
101 apend. scripting, crond, atd101 apend. scripting, crond, atd
101 apend. scripting, crond, atd
 

More from aradhana9856

First lets draw out the Lewis structure such that each atom has.pdf
 First lets draw out the Lewis structure such that each atom has.pdf First lets draw out the Lewis structure such that each atom has.pdf
First lets draw out the Lewis structure such that each atom has.pdf
aradhana9856
 
Interest.javaimport java.util.Scanner; public class Interest.pdf
 Interest.javaimport java.util.Scanner; public class Interest.pdf Interest.javaimport java.util.Scanner; public class Interest.pdf
Interest.javaimport java.util.Scanner; public class Interest.pdf
aradhana9856
 
13. The answer is C. 34Let D be the dominant allele and d be the.pdf
13. The answer is C. 34Let D be the dominant allele and d be the.pdf13. The answer is C. 34Let D be the dominant allele and d be the.pdf
13. The answer is C. 34Let D be the dominant allele and d be the.pdf
aradhana9856
 
1) The Arrhenius Theory of acids and bases Acids are substances wh.pdf
  1) The Arrhenius Theory of acids and bases  Acids are substances wh.pdf  1) The Arrhenius Theory of acids and bases  Acids are substances wh.pdf
1) The Arrhenius Theory of acids and bases Acids are substances wh.pdf
aradhana9856
 
1. Coenzyme A - C. A water soluble acyl group carrier.2. Thiamine .pdf
1. Coenzyme A - C. A water soluble acyl group carrier.2. Thiamine .pdf1. Coenzyme A - C. A water soluble acyl group carrier.2. Thiamine .pdf
1. Coenzyme A - C. A water soluble acyl group carrier.2. Thiamine .pdf
aradhana9856
 
Using Clausius-Clapeyron relation Ln(P2P1) = (D.pdf
                     Using Clausius-Clapeyron relation Ln(P2P1) = (D.pdf                     Using Clausius-Clapeyron relation Ln(P2P1) = (D.pdf
Using Clausius-Clapeyron relation Ln(P2P1) = (D.pdf
aradhana9856
 
purines are double ringed nitrogenous bases of DN.pdf
                     purines are double ringed nitrogenous bases of DN.pdf                     purines are double ringed nitrogenous bases of DN.pdf
purines are double ringed nitrogenous bases of DN.pdf
aradhana9856
 
(i) Deques cannot be implemented using arrays. false    Justif.pdf
(i) Deques cannot be implemented using arrays.  false    Justif.pdf(i) Deques cannot be implemented using arrays.  false    Justif.pdf
(i) Deques cannot be implemented using arrays. false    Justif.pdf
aradhana9856
 
no reaction note 1-butanol is a primary alcohol.pdf
                     no reaction  note 1-butanol is a primary alcohol.pdf                     no reaction  note 1-butanol is a primary alcohol.pdf
no reaction note 1-butanol is a primary alcohol.pdf
aradhana9856
 
What type of variable is number of people in the roomNominal.pdf
What type of variable is number of people in the roomNominal.pdfWhat type of variable is number of people in the roomNominal.pdf
What type of variable is number of people in the roomNominal.pdf
aradhana9856
 
What is the oxidation number for oxygen in H2O2; for OF2 Explain..pdf
What is the oxidation number for oxygen in H2O2; for OF2  Explain..pdfWhat is the oxidation number for oxygen in H2O2; for OF2  Explain..pdf
What is the oxidation number for oxygen in H2O2; for OF2 Explain..pdf
aradhana9856
 
We all know humans are good at removing the competition and it is di.pdf
We all know humans are good at removing the competition and it is di.pdfWe all know humans are good at removing the competition and it is di.pdf
We all know humans are good at removing the competition and it is di.pdf
aradhana9856
 
Theories devised by keynes and Minsky are similar in concept since M.pdf
Theories devised by keynes and Minsky are similar in concept since M.pdfTheories devised by keynes and Minsky are similar in concept since M.pdf
Theories devised by keynes and Minsky are similar in concept since M.pdf
aradhana9856
 
They might have consumed cyanide.The pit of Apricot contains cyani.pdf
They might have consumed cyanide.The pit of Apricot contains cyani.pdfThey might have consumed cyanide.The pit of Apricot contains cyani.pdf
They might have consumed cyanide.The pit of Apricot contains cyani.pdf
aradhana9856
 
The attacking of the nucleophile formed in the reactionof acetone an.pdf
The attacking of the nucleophile formed in the reactionof acetone an.pdfThe attacking of the nucleophile formed in the reactionof acetone an.pdf
The attacking of the nucleophile formed in the reactionof acetone an.pdf
aradhana9856
 
Terry And Hill can develop a method of profit sharing on below facto.pdf
Terry And Hill can develop a method of profit sharing on below facto.pdfTerry And Hill can develop a method of profit sharing on below facto.pdf
Terry And Hill can develop a method of profit sharing on below facto.pdf
aradhana9856
 
The algorithm to reverse a linked list by rearranging the required p.pdf
The algorithm to reverse a linked list by rearranging the required p.pdfThe algorithm to reverse a linked list by rearranging the required p.pdf
The algorithm to reverse a linked list by rearranging the required p.pdf
aradhana9856
 
Splicing mechanismSmall nuclear ribonucleic acid (snRNA) It is al.pdf
Splicing mechanismSmall nuclear ribonucleic acid (snRNA) It is al.pdfSplicing mechanismSmall nuclear ribonucleic acid (snRNA) It is al.pdf
Splicing mechanismSmall nuclear ribonucleic acid (snRNA) It is al.pdf
aradhana9856
 
since both are strong acids we can add up their individual contribut.pdf
since both are strong acids we can add up their individual contribut.pdfsince both are strong acids we can add up their individual contribut.pdf
since both are strong acids we can add up their individual contribut.pdf
aradhana9856
 
public int getPosition(T anObject) { int result = null; result .pdf
public int getPosition(T anObject) { int result = null;  result .pdfpublic int getPosition(T anObject) { int result = null;  result .pdf
public int getPosition(T anObject) { int result = null; result .pdf
aradhana9856
 

More from aradhana9856 (20)

First lets draw out the Lewis structure such that each atom has.pdf
 First lets draw out the Lewis structure such that each atom has.pdf First lets draw out the Lewis structure such that each atom has.pdf
First lets draw out the Lewis structure such that each atom has.pdf
 
Interest.javaimport java.util.Scanner; public class Interest.pdf
 Interest.javaimport java.util.Scanner; public class Interest.pdf Interest.javaimport java.util.Scanner; public class Interest.pdf
Interest.javaimport java.util.Scanner; public class Interest.pdf
 
13. The answer is C. 34Let D be the dominant allele and d be the.pdf
13. The answer is C. 34Let D be the dominant allele and d be the.pdf13. The answer is C. 34Let D be the dominant allele and d be the.pdf
13. The answer is C. 34Let D be the dominant allele and d be the.pdf
 
1) The Arrhenius Theory of acids and bases Acids are substances wh.pdf
  1) The Arrhenius Theory of acids and bases  Acids are substances wh.pdf  1) The Arrhenius Theory of acids and bases  Acids are substances wh.pdf
1) The Arrhenius Theory of acids and bases Acids are substances wh.pdf
 
1. Coenzyme A - C. A water soluble acyl group carrier.2. Thiamine .pdf
1. Coenzyme A - C. A water soluble acyl group carrier.2. Thiamine .pdf1. Coenzyme A - C. A water soluble acyl group carrier.2. Thiamine .pdf
1. Coenzyme A - C. A water soluble acyl group carrier.2. Thiamine .pdf
 
Using Clausius-Clapeyron relation Ln(P2P1) = (D.pdf
                     Using Clausius-Clapeyron relation Ln(P2P1) = (D.pdf                     Using Clausius-Clapeyron relation Ln(P2P1) = (D.pdf
Using Clausius-Clapeyron relation Ln(P2P1) = (D.pdf
 
purines are double ringed nitrogenous bases of DN.pdf
                     purines are double ringed nitrogenous bases of DN.pdf                     purines are double ringed nitrogenous bases of DN.pdf
purines are double ringed nitrogenous bases of DN.pdf
 
(i) Deques cannot be implemented using arrays. false    Justif.pdf
(i) Deques cannot be implemented using arrays.  false    Justif.pdf(i) Deques cannot be implemented using arrays.  false    Justif.pdf
(i) Deques cannot be implemented using arrays. false    Justif.pdf
 
no reaction note 1-butanol is a primary alcohol.pdf
                     no reaction  note 1-butanol is a primary alcohol.pdf                     no reaction  note 1-butanol is a primary alcohol.pdf
no reaction note 1-butanol is a primary alcohol.pdf
 
What type of variable is number of people in the roomNominal.pdf
What type of variable is number of people in the roomNominal.pdfWhat type of variable is number of people in the roomNominal.pdf
What type of variable is number of people in the roomNominal.pdf
 
What is the oxidation number for oxygen in H2O2; for OF2 Explain..pdf
What is the oxidation number for oxygen in H2O2; for OF2  Explain..pdfWhat is the oxidation number for oxygen in H2O2; for OF2  Explain..pdf
What is the oxidation number for oxygen in H2O2; for OF2 Explain..pdf
 
We all know humans are good at removing the competition and it is di.pdf
We all know humans are good at removing the competition and it is di.pdfWe all know humans are good at removing the competition and it is di.pdf
We all know humans are good at removing the competition and it is di.pdf
 
Theories devised by keynes and Minsky are similar in concept since M.pdf
Theories devised by keynes and Minsky are similar in concept since M.pdfTheories devised by keynes and Minsky are similar in concept since M.pdf
Theories devised by keynes and Minsky are similar in concept since M.pdf
 
They might have consumed cyanide.The pit of Apricot contains cyani.pdf
They might have consumed cyanide.The pit of Apricot contains cyani.pdfThey might have consumed cyanide.The pit of Apricot contains cyani.pdf
They might have consumed cyanide.The pit of Apricot contains cyani.pdf
 
The attacking of the nucleophile formed in the reactionof acetone an.pdf
The attacking of the nucleophile formed in the reactionof acetone an.pdfThe attacking of the nucleophile formed in the reactionof acetone an.pdf
The attacking of the nucleophile formed in the reactionof acetone an.pdf
 
Terry And Hill can develop a method of profit sharing on below facto.pdf
Terry And Hill can develop a method of profit sharing on below facto.pdfTerry And Hill can develop a method of profit sharing on below facto.pdf
Terry And Hill can develop a method of profit sharing on below facto.pdf
 
The algorithm to reverse a linked list by rearranging the required p.pdf
The algorithm to reverse a linked list by rearranging the required p.pdfThe algorithm to reverse a linked list by rearranging the required p.pdf
The algorithm to reverse a linked list by rearranging the required p.pdf
 
Splicing mechanismSmall nuclear ribonucleic acid (snRNA) It is al.pdf
Splicing mechanismSmall nuclear ribonucleic acid (snRNA) It is al.pdfSplicing mechanismSmall nuclear ribonucleic acid (snRNA) It is al.pdf
Splicing mechanismSmall nuclear ribonucleic acid (snRNA) It is al.pdf
 
since both are strong acids we can add up their individual contribut.pdf
since both are strong acids we can add up their individual contribut.pdfsince both are strong acids we can add up their individual contribut.pdf
since both are strong acids we can add up their individual contribut.pdf
 
public int getPosition(T anObject) { int result = null; result .pdf
public int getPosition(T anObject) { int result = null;  result .pdfpublic int getPosition(T anObject) { int result = null;  result .pdf
public int getPosition(T anObject) { int result = null; result .pdf
 

Recently uploaded

CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 

Recently uploaded (20)

CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 

Hello,Ther is some problem in you codeI made my own programme as.pdf

  • 1. Hello, Ther is some problem in you code I made my own programme as per your requirement Please check my solution :- 1)Create one FIFO 2)From Client write character first and wait for some time so that server will read it 3) After wait for some time write integer Server programme :- --------------------------------------- #include #include #include #include #include int main() { int client_to_server; char *myfifo = "/tmp/client_to_server_fifo"; char str; int iteration; /* create the FIFO (named pipe) */ mkfifo(myfifo, 0666); /* open, read, and display the message from the FIFO */ client_to_server = open(myfifo, O_RDONLY); printf("Server ON. "); read(client_to_server, &str, sizeof(str)); read(client_to_server, &iteration, sizeof(iteration)); close(client_to_server); unlink(myfifo); //Now Print the character for(int i = 0; i < iteration ; i++){ printf("Iteration ::%d and Character:: %c ",i,str); }
  • 2. return 0; } Client Programme :- --------------------------------------- #include #include #include #include #include int main() { int client_to_server; char *myfifo = "/tmp/client_to_server_fifo"; char str; int iteration; printf("Client: Please enter a character: "); scanf("%c", &str); printf("Client: Please enter an integer: "); scanf("%d", &iteration); /* write str to the FIFO */ client_to_server = open(myfifo, O_WRONLY); //First write character write(client_to_server, &str, sizeof(str)); //wait for some time so that server will read character sleep(0.250); //Then write integer write(client_to_server, &iteration, sizeof(iteration)); perror("Write:"); //Very crude error check printf("...received from the server: %s ",str); close(client_to_server); /* remove the FIFO */ return 0; }
  • 3. Solution Hello, Ther is some problem in you code I made my own programme as per your requirement Please check my solution :- 1)Create one FIFO 2)From Client write character first and wait for some time so that server will read it 3) After wait for some time write integer Server programme :- --------------------------------------- #include #include #include #include #include int main() { int client_to_server; char *myfifo = "/tmp/client_to_server_fifo"; char str; int iteration; /* create the FIFO (named pipe) */ mkfifo(myfifo, 0666); /* open, read, and display the message from the FIFO */ client_to_server = open(myfifo, O_RDONLY); printf("Server ON. "); read(client_to_server, &str, sizeof(str)); read(client_to_server, &iteration, sizeof(iteration)); close(client_to_server); unlink(myfifo); //Now Print the character for(int i = 0; i < iteration ; i++){
  • 4. printf("Iteration ::%d and Character:: %c ",i,str); } return 0; } Client Programme :- --------------------------------------- #include #include #include #include #include int main() { int client_to_server; char *myfifo = "/tmp/client_to_server_fifo"; char str; int iteration; printf("Client: Please enter a character: "); scanf("%c", &str); printf("Client: Please enter an integer: "); scanf("%d", &iteration); /* write str to the FIFO */ client_to_server = open(myfifo, O_WRONLY); //First write character write(client_to_server, &str, sizeof(str)); //wait for some time so that server will read character sleep(0.250); //Then write integer write(client_to_server, &iteration, sizeof(iteration)); perror("Write:"); //Very crude error check printf("...received from the server: %s ",str); close(client_to_server); /* remove the FIFO */