Quote:
Originally posted by cranium2004
How can i create a flexibility at each system so that it will not only listen from client socket but will also communicate to another server socket.
|
You can just open more than one socket, and use the select() function to have your program do nothing (sleep) until there's some activity on one of the sockets. Using select() is non-trivial, but there's some good documentation in it:
man 2 select # regular man page
man 2 select_tut # extra, tutorial man page.
Quote:
For that i think it require me to make both programs daemon so that they will run as backgroung hidden process.
How to do that on redhat linux 9 machnes with i386 arch?
|
Running as a daemon is not required to be listening on more-than-one socket at a time. But to make a program run as a daemon, just #include <unistd.h> and call daemon(0,0).