Cdg Server
Description
I try to build a cdgp-server in perl which can handle different cdgp-processes at the same time.
Following commands should be provided:
- NEW - open a cdgp-process
- SCRIPT - commands for an existing cdg-process
- STATUS - gives a list over all processes
- CPU - CPU load
- QUIT the server
At the moment I try to implement "NEW".
Some problems occur:
What is wanted is a bidirectional Communication betweeen the server and the cdg-processes.
Intuitively one could write something as the following:
open(PROG_FOR_READING_AND_WRITING, "| cdgp |")
But, of course, that's not possible.
If you consult the perlipc-manual, you are given different approaches to solve the problem:
- use of open2() or open3() Unix buffering may make this strategy unprofitable
- the nonstandard library Comm.pl
- Expect.pm
I tried the open2(), but it doesn't work because of buffering.
Now the same project not in perl but in tcl.
Comments