|Newbie questions about Pliant
I just want to make sure that Pliant doesn't
have a neater way of controlling or passing messages
to a process.
|Message posted by mujtaba on 2003/11/30 00:16:37
|I wrote an mpeg viewer (SDL bindings) and I had this idea of
using the http_server as a front-end. So before I start learning to generate
signal interrupts in Pliant, I just want to make sure that Pliant doesn't
have a neater way of controlling or passing messages to a process.
I've thought of inlining SDL code in a .page, but I'm not so sure how that
I might as well ask, how do I generate posix signals in Pliant?
|Message posted by hubert.tonneau on 2003/11/30 20:06:56
|> I might as well ask, how do I generate posix signals in Pliant?
Pliant does not provide a signaling API since it's not portable enough.
So, if you include module /pliant/language/os.pli
then you can use 'os_kill' function, which is mapping C 'kill' function, but it
will not work on plateforms such as Win32.
Also, I may have not mapped all the constants related to signals.
What you have to do is look at the 'signals' part of the /pliant/language/os/linux.pli
|Message posted by mujtaba on 2003/12/02 02:18:56
|I heard from marcus (I think) that pliant has a remote process control
facility or other. Is this true? How do I use it?
|Message posted by hubert.tonneau on 2003/12/02 22:50:37
|Pliant has a remote execution mechanism (RPC).
The implementation is:
. Internet safe (you can safely remote execute over the Internet)
. slow (each call will establish a new TCP connection, authenticate, and all
variables will be exchanged in ASCII)
The hardest part of using it is properly setting secured channel.
Each machine must have an entry in 'configure' 'names' 'host' that will specify
it's IP address, TCP ports used and most important it's public key.
Each machine must know all the public keys of all others, but be the only one
to know it's private key, so you have to always generate the key locally, then
cut past the public key to other machines.
Use 'configure' 'remote execution' 'test remote access' to verify that everything
Then using remote execution is something like:
var Int i := 2 ; var Int j
control c c="myserver.mydomain.org"
j := 2*i
console "there is a problem"
console "result is " j eol
In the sample, the bloc under the 'remote' instruction will be executed remotely.
Pliant will automatically pass required variables (here 'i' and 'j'), and
you have to specify the variables that the remote machine is allowed to modify.
You can also use a 'control' instruction to check that the remote machine is
one of the one that is allowed to ask you to remote execute some code.
If the function is in a module with .remote extension, it can be automatically
loaded by the target machine. If the module extension is .pli, then if nothing
forced the module to load previously, the remote call will fail.
Lastly, there is a mechanism that can be used to exchange freely datas over
a stream between the two machines (send complex datas, files, etc)
|Message posted by mujtaba on 2003/12/04 00:40:04
|Okay, what about opening a pipe then? Windows has popen2,
so itshould be cross platform. Is there a standard Pliant
interface for that?
|Message posted by hubert.tonneau on 2003/12/04 09:53:37
|A local TCP connection will basically bring you the same.
I just tested a local TCP connection on a modern desktop computer, and found it
to cary 5 Gbps.
|Message posted by hubert.tonneau on 2003/12/04 09:58:37
|About pipes, there is a /pliant/language/stream/pipe.pli module that I use
to create pipes for communication with Unix commands that I start with 'execute'
and expect to communicate through stdin and stdout, but I cannot recommand using
it outside the Unix world.