09-28-2013
Your statement of requirements and your code snippets do not seem to be related to each other at all. You talk about reading data from a user, but there is absolutely nothing in your while loop that reads any data. You talk about the functions doEcho() and doDayTime(), but there are no definitions for these functions and no calls to these functions. You talk about network programming and you talk about half-duplex pipes, but there are no pipes and you aren't showing us how your socket is set up. You have a doprocessing() function that each child process calls, but, again, there is no declaration for this function.
With all of the missing declarations, missing functions, missing context, I'm not going to try to recreate and debug your program. By visual inspection, it still looks to me like the parent will fork() as many children as it can until the system is saturated or the system starts failing fork()s due to user process count limits.
With all of this confusion and missing details, I have no idea how to help you. The only thing I can suggest is to go back to your online tutorial and seek help from the people who maintain that tutorial; maybe they will have the needed context to understand what you're trying to do.
10 More Discussions You Might Find Interesting
1. Programming
Dear All,
Would you tell me how I can passing a message along pipes?
I have built a token ring connected with pipes, but I don't know how to pass the message along it through the command line...
Thx.
Yours,
i- (1 Reply)
Discussion started by: iminus
1 Replies
2. Filesystems, Disks and Memory
:(
Since I'm fairly new to the scene and don't have much experience in shell programming, I decided to check out the net for a useful script or two.
What I'm looking for is a script that would let me enter a PID and then show the process tree associated with it.
So it would display the (grand-)... (2 Replies)
Discussion started by: velde046
2 Replies
3. Programming
Hi all,
I'm trying to write a program that has some data it wants to send through a filter program(in this case tr), and then recieve the output from that filter program. The way I'm trying to do it is by setting up two pipes between the programs and piping the data in through one pipe and back... (2 Replies)
Discussion started by: bwgoudey
2 Replies
4. Shell Programming and Scripting
Hello.
I have a global function name func1() that I am sourcing in from script A. I call the function from script B. Is there a way to find out which script called func1() dynamically so that the func1() can report it in the event there are errors?
Thanks (2 Replies)
Discussion started by: yoi2hot4ya
2 Replies
5. Shell Programming and Scripting
Hi
I have written a script using ftp to get files from one server and copy them to 2 dirrerent servers. I wish to call this script from a parent script that will check the number of files copied and run a check sum for each file. As the filenames for the files in the get portion of the script... (3 Replies)
Discussion started by: Andy82
3 Replies
6. Programming
Hi guys, I'm having some problem here, I'm studying pipes, and i want to create a shell in C and at this point a don't want to use semaphores, instead I want to use tricks. Straight to the doubt: I've a parent and a child process, and both of them has some code to execute, and the child process... (5 Replies)
Discussion started by: pharaoh
5 Replies
7. Homework & Coursework Questions
1. The problem statement, all variables and given/known data:
I need to make an program that in a loop creates one parent and five children with fork(). The problem i'm trying to solve is how to delete the parent and child of the childīs process.
2. Relevant commands, code, scripts,... (0 Replies)
Discussion started by: WhiteFace
0 Replies
8. Shell Programming and Scripting
Hi everyone
i am very new to linux , working on bash shell.
I am trying to solve the given problem
1. Create a process and then create children using fork
2. Check the Status of the application for successful running.
3. Kill all the process(threads) except parent and first child... (2 Replies)
Discussion started by: vizz_k
2 Replies
9. Programming
I have a simple client/server program I am using for learning purposes.
I have it setup so that after server is setup and listening it than goes into a loop where it accepts incoming client connections. After each connection, the client socket is than passed to a thread routine where it can be... (3 Replies)
Discussion started by: Majortom71
3 Replies
10. Shell Programming and Scripting
Hi Forum.
I have this challenging issue that I'm hoping someone can help me.
I have a file that contains 3 different types of segments (AM00, AM01, AM32) in a hierarchy structure and I want to be able to pass the column key from the parent record to the children records.
AM00 - parent key:... (13 Replies)
Discussion started by: pchang
13 Replies
TALK(1) BSD General Commands Manual TALK(1)
NAME
talk -- talk to another user
SYNOPSIS
talk person [ttyname]
DESCRIPTION
The talk utility is a visual communication program which copies lines from your terminal to that of another user.
Options available:
person If you wish to talk to someone on your own machine, then person is just the person's login name. If you wish to talk to a user on
another host, then person is of the form 'user@host' or 'host!user' or 'host:user'.
ttyname If you wish to talk to a user who is logged in more than once, the ttyname argument may be used to indicate the appropriate terminal
name, where ttyname is of the form 'ttyXX'.
When first called, talk sends the message
Message from TalkDaemon@his_machine...
talk: connection requested by your_name@your_machine.
talk: respond with: talk your_name@your_machine
to the user you wish to talk to. At this point, the recipient of the message should reply by typing
talk your_name@your_machine
It does not matter from which machine the recipient replies, as long as his login-name is the same. Once communication is established, the
two parties may type simultaneously, with their output appearing in separate windows. Typing control-L '^L' will cause the screen to be
reprinted. Typing control-D '^D' will clear both parts of your screen to be cleared, while the control-D character will be sent to the
remote side (and just displayed by this talk client). Your erase, kill, and word kill characters will behave normally. To exit, just type
your interrupt character; talk then moves the cursor to the bottom of the screen and restores the terminal to its previous state.
Permission to talk may be denied or granted by use of the mesg(1) command. At the outset talking is allowed.
CONFIGURATION
The talk utility relies on the talkd system daemon. See talkd(8) for information about enabling talkd.
FILES
/etc/hosts to find the recipient's machine
/var/run/utmpx to find the recipient's tty
SEE ALSO
mail(1), mesg(1), wall(1), who(1), write(1), talkd(8)
HISTORY
The talk command appeared in 4.2BSD.
In FreeBSD 5.3, the default behaviour of talk was changed to treat local-to-local talk requests as originating and terminating at localhost.
Before this change, it was required that the hostname (as per gethostname(3)) resolved to a valid IPv4 address (via gethostbyname(3)), making
talk unsuitable for use in configurations where talkd(8) was bound to the loopback interface (normally for security reasons).
BUGS
The version of talk released with 4.3BSD uses a protocol that is incompatible with the protocol used in the version released with 4.2BSD.
Multibyte characters are not recognized.
BSD
August 21, 2008 BSD