snafu has asked for the wisdom of the Perl Monks concerning the following question:
I have a server that allows interactive use from the clients. The server talks to the clients using udp messages and logs everything that goes on. The clients that connect to the server have a unique ability to be able to send a single udp packet to each other or anything else listening on a port somewhere for a udp packet. The server can be remotely administered if sent the proper information.
So, to recap, I have a server that can be monitored two ways
and
In order to watch the logfile, I have successfully created a routine that can watch the logfile with a tail -f like ability. This code however, is a true loop in itself...
Now, the next thing I decided to do was set up the ability to create a UDP server in perl so that the client can talk to my server and send requests that way. The thing that makes this difficult is:
The UDP server listens via a true loop.
See my problem? I can't have two true loops running independently of each other simultaneoulsy can I?
Here is what I have thought of doing; modular construction of the script. Create a main script that handles the spawning of two children processes that talk to the main script. The two children processes will actually be the network piece and the logfile watching piece. They will tell the main piece what to do which has the networking code in place to talk to the server.
My question is this: Is this the best way to go? Is my idea capable of working or should I think of some other more foolproof way? I have never used IPC before, but perhaps this would be a decent time to learn? Should I use IPC?
TIA
----------
- Jim
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Should I use IPC? Perhaps something else...*shrug*
by no_slogan (Deacon) on May 10, 2001 at 01:33 UTC | |
|
Re: Should I use IPC? Perhaps something else...*shrug*
by repson (Chaplain) on May 10, 2001 at 09:45 UTC | |
by snafu (Chaplain) on May 11, 2001 at 03:12 UTC |