home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / me34src.zip / me3 / comserver / comserver.doc < prev    next >
Text File  |  1995-01-14  |  3KB  |  74 lines

  1. ========================================================================
  2. ==         Compute Server                  Craig Durland 11/91 ==
  3. ========================================================================
  4.  
  5. The compute server is just a process that excepts commands to be run,
  6. runs them and sends the output back to the requester.  It is based on a
  7. client/server model:  the compute server is a server that services
  8. requests made by a client.
  9.  
  10.         .--------.              .--------.              .---------.
  11.            | Client |   --request-->     | Server |<--output--| Process |
  12.     |        | <--process output--|           |       |         |
  13.     `--------'                `--------'       `---------'
  14.  
  15. The client requests the server to run a command (process).  The server
  16. does so and pass everything the process writes to stdout and stderr back
  17. to the client.
  18.  
  19. The code is written for Unix and should be generic as long you have
  20. sockets.  If you don't it could be a pain to port.
  21.  
  22. The compute server can support a bunch of clients each of which can
  23. request a bunch of process to be run, all at the same time.
  24.  
  25. ======================================================================
  26. ==            How to Run                    ==
  27. ======================================================================
  28.  
  29. To run the compute server:
  30.     comserver socket-name
  31. socket-name is a file that will be used (as a socket) for the compute
  32. server and client to talk to each other through.  If you are using the
  33. server with ME2, the socket name is "$HOME/.ME2.socket".
  34.  
  35. Need to add logging.
  36.  
  37. ======================================================================
  38. ==            Commands                    ==
  39. ======================================================================
  40.  
  41. There are limits to what the compute server can do for you.  The
  42. processes are treated as read only - you can't send info down to the
  43. process, you can only get info from it.  This means things like make,
  44. grep, etc can be run just fine, but programs that require input won't
  45. work.
  46.  
  47. Syntax:
  48.   Command args
  49.   Args are broken up at white space boundaries unless in "".
  50.   For example:
  51.     foo 1 2 "3 4"
  52.     results in:
  53.       argv[0] = foo
  54.       argv[1] = "1"
  55.       argv[2] = "2"
  56.       argv[3] = "3 4"
  57.   $PATH is used to search for foo.
  58.  
  59. Command arguments are NOT expanded - things like *.c, ~/foo.c, etc will
  60. not be expanded and probably cause your process to choke.  If you want
  61. expansion done, use your favorite shell:
  62.   /bin/sh -c "ls *.c"
  63.  
  64. There is a stupid limit on how long the command can be (about 200
  65. characters).
  66.  
  67. ======================================================================
  68. ==    Using the Compute Server in Your Program            ==
  69. ======================================================================
  70.  
  71. Its pretty easy, I just don't feel like documenting right now.  Check
  72. out process.c in me2.
  73.  
  74.