home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
me34src.zip
/
me3
/
comserver
/
comserver.doc
< prev
next >
Wrap
Text File
|
1995-01-14
|
3KB
|
74 lines
========================================================================
== Compute Server Craig Durland 11/91 ==
========================================================================
The compute server is just a process that excepts commands to be run,
runs them and sends the output back to the requester. It is based on a
client/server model: the compute server is a server that services
requests made by a client.
.--------. .--------. .---------.
| Client | --request--> | Server |<--output--| Process |
| | <--process output--| | | |
`--------' `--------' `---------'
The client requests the server to run a command (process). The server
does so and pass everything the process writes to stdout and stderr back
to the client.
The code is written for Unix and should be generic as long you have
sockets. If you don't it could be a pain to port.
The compute server can support a bunch of clients each of which can
request a bunch of process to be run, all at the same time.
======================================================================
== How to Run ==
======================================================================
To run the compute server:
comserver socket-name
socket-name is a file that will be used (as a socket) for the compute
server and client to talk to each other through. If you are using the
server with ME2, the socket name is "$HOME/.ME2.socket".
Need to add logging.
======================================================================
== Commands ==
======================================================================
There are limits to what the compute server can do for you. The
processes are treated as read only - you can't send info down to the
process, you can only get info from it. This means things like make,
grep, etc can be run just fine, but programs that require input won't
work.
Syntax:
Command args
Args are broken up at white space boundaries unless in "".
For example:
foo 1 2 "3 4"
results in:
argv[0] = foo
argv[1] = "1"
argv[2] = "2"
argv[3] = "3 4"
$PATH is used to search for foo.
Command arguments are NOT expanded - things like *.c, ~/foo.c, etc will
not be expanded and probably cause your process to choke. If you want
expansion done, use your favorite shell:
/bin/sh -c "ls *.c"
There is a stupid limit on how long the command can be (about 200
characters).
======================================================================
== Using the Compute Server in Your Program ==
======================================================================
Its pretty easy, I just don't feel like documenting right now. Check
out process.c in me2.