LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-24-2016, 12:14 PM   #1
NetProgrammer
Member
 
Registered: Aug 2012
Posts: 30

Rep: Reputation: Disabled
Send and receive


Dear friends,
I have to write 3 programms A, B and C (using pipe or socket)

The program A should receive data from B continously and send them to C.
I need some relative sample code in c.
Can anybody help me ?
 
Old 01-24-2016, 12:57 PM   #2
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
This should be a good resource:

http://www.makelinux.net/alp/
 
1 members found this post helpful.
Old 01-24-2016, 12:58 PM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by NetProgrammer View Post
Dear friends,
I have to write 3 programms A, B and C (using pipe or socket)

The program A should receive data from B continously and send them to C. I need some relative sample code in c. Can anybody help me ?
Read the "Question Guidelines" in my posting signature. Putting "C program send data pipe" into Google pulls up 1.3 MILLION results...the first two have samples. Putting "c program send data socket" pulls up 1.5 million....again, with samples.

Do basic research on your own first, before posting a question like this. We're happy to help you, but don't (essentially) ask people to look up things for you. And since you've now been working with C socket programming for FOUR YEARS:
http://www.linuxquestions.org/questi...et-4175425361/

...it's hard to believe you've made no progress on your own in that time.

Last edited by TB0ne; 01-24-2016 at 01:00 PM.
 
1 members found this post helpful.
Old 01-25-2016, 07:38 PM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
Also, since this is undoubtedly homework, do not leave your instructor out of the loop! That's what s/he is being paid to do ... with your tuition!

"Pipes" are a marvelous invention of Unix/Linux which, in their simplest form, are simply "a file." Or, to the program(s) in question, they appear to be! But pipes synchronize the activity of the readers and writers. Readers wait if the pipe becomes empty; writers wait if the pipe becomes full. Neither of them has to even know that they are reading or writing to "a pipe."

You use pipes unconsciously whenever you use the "| character in a shell command. The character is called "pipe," and we talk of "piping [the output of] one program to [the input of] another," and, whenever we do that, "that's exactly what we are doing ... using pipes."

Now, if you're still befuddled ... get with your instructor! Ask questions. You'll be doing a service to your fellow classmates who are also "befuddled, and afraid to ask."
 
Old 01-28-2016, 07:41 AM   #5
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Prior effort on my part, a lot of duplication and editing on your part to copy and then modify the architecture to do what you want, but check my blog entries. There are examples of pipe architecture written in the C language.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to enable the send mail for receive and send the requests for the orangeHRM reddisekhar Linux - Newbie 3 12-13-2015 01:15 PM
[SOLVED] Can send and receive plain text mail, but can't receive on html pravada Linux - Server 6 05-20-2013 03:25 PM
[SOLVED] Can send and receive plain text mail, but can't receive on html pravada Linux - Software 1 05-17-2013 03:13 PM
Postfix : mail cannot send to send outside ( can send/receive locally) bobbinsupport Linux - Networking 3 12-15-2007 10:40 PM
Server does'nt send mail until shutdown and LAN can't send or receive. Wolfy Linux - Networking 0 08-02-2004 07:31 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration