Annotation of OpenXM/doc/issac2000/openxm-clients.tex, Revision 1.4
1.4 ! ohara 1: % $OpenXM: OpenXM/doc/issac2000/openxm-clients.tex,v 1.3 2000/01/11 05:17:11 noro Exp $
1.2 takayama 2:
3: \section{OpenXM Clients}
4: (noryo and Ohara)
5: MEMO: keywords:
6: Asir and Mathematica clients.
1.3 noro 7:
8: \subsection{Risa/Asir}
9:
10: Risa/Asir provides a launcher to invoke an OpenXM server and to set up the
11: communication between the server and itself. It also provides primitives
12: for communication as built-in functions.
13:
14: \subsubsection{{\tt ox\_launch}}
15: {\tt ox\_launch} is a general purpose launcher. This application
16: invokes a server and initiates the server-client communication
17: according to the protocol stated in Section \ref{launcher}, then
18: itself becomes a control server.
19: Several facilities related to {{\tt ox\_launch}} are provided
20: as built-in functions of Risa/Asir: a function to invoke a server
21: automatically from a give host name and a server name, and a set
22: of functions to execute the port generation, {\tt bind}, {\tt listen},
23: {\tt connect} and {\tt accept} operations on sockets individually.
24:
25: \subsubsection{Manipulating servers}
26:
27: Fundamental operations on OpenXM servers are sending and receiving
28: of {\tt OX} data and sending of {\tt OX} commands. The following functions
29: are provided to execute these primitive operations:
30: {\tt ox\_push\_cmo()} for pushing data to a server,
31: {\tt ox\_push\_cmd()} for sending an {\tt SM} command to a server
32: and {\tt ox\_get()} for receiving data from a stream.
33:
34: Some operations including the reset operation are realized by
35: combining these primitives. Among them, frequently used ones are
36: provided as built-in functions. We show several ones.
37:
38: \begin{itemize}
39: \item {\tt ox\_pop\_cmo()}
40:
41: It requests a server to send data on the stack to the stream, then
42: it receives the data from the stream.
43:
44: \item {\tt ox\_cmo\_rpc()}
45:
46: After pushing the name of a function, arguments and the number of the
1.4 ! ohara 47: arguments to the stack of a server, it request the server to execute
1.3 noro 48: the function. It does not wait the termination of the function call.
49:
50: \item {\tt ox\_reset()}
51:
52: After sending {\tt SM\_control\_reset\_connection} to a control server,
53: it completes the operations stated in Section \ref{control}.
54: \end{itemize}
55: Furthermore {\tt ox\_select()} is provided to detect streams ready for
56: reading. It is realized by the {\tt select()} system call and is used
57: to avoid blocking on read operations.
1.4 ! ohara 58:
! 59: \subsection{Mathematica}
! 60:
! 61: We provide an OpenXM client {\tt math2ox} written as an external module
! 62: for Mathematica. Our client communicates to Mathematica by MathLink and
! 63: to an OpenXM server by OpenXM protocols. The {\tt math2ox} needs
! 64: {\tt ox} command attached to kan/sm1 to connect an OpenXM server.
! 65:
! 66: \subsubsection{Functions}
! 67:
! 68: The {\tt math2ox} has the following functions functions named
! 69: like Risa/Asir;
! 70: \begin{quote}
! 71: {\tt OxStart[s\_String]} \\
! 72: {\tt OxStartInsecure[s\_String]} \\
! 73: {\tt OxExecuteString[s\_String]} \\
! 74: {\tt OxParse[s\_String]} \\
! 75: {\tt OxGet[]} \\
! 76: {\tt OxPopCMO[]} \\
! 77: {\tt OxPopString[]} \\
! 78: {\tt OxClose[]} \\
! 79: {\tt OxReset[]}
! 80: \end{quote}
! 81: For example, the {\tt OxPopCMO[]} function above requests a server to
! 82: send data on the stack to the stream, then it receives the data from the
! 83: stream.
! 84:
! 85: The {\tt OxParse[]} and the {\tt OxGet[]} above are low level functions.
! 86: By using the {\tt OxParse[]} function, we can send suitable OX messages,
! 87: which are written as an OX expression, to a server. OX expressions are
! 88: Lisp-like expressions for OX messages and are defined
! 89: in~\cite{noro-takayama}. The {\tt OxGet[]} receives an OX data message
! 90: and returns its object.
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>