Annotation of OpenXM/doc/issac2000/ox-messages.tex, Revision 1.5
1.5 ! noro 1: %%$OpenXM: OpenXM/doc/issac2000/ox-messages.tex,v 1.4 2000/01/13 10:57:10 ohara Exp $
1.1 takayama 2:
1.4 ohara 3: \section{OX messages}
1.1 takayama 4:
5: An OX message for TCP/IP is a byte stream consisting of
6: a header and a body.
7: \begin{center}
8: \begin{tabular}{|c|c|}
9: \hline
10: Header & \hspace{10mm} Body \hspace{10mm} \\
11: \hline
12: \end{tabular}
13: \end{center}
14: The header consists of two signed 32 bit integers.
15: The first one is an OX tag
16: and the second one is a serial number of the OX message.
17: Negative numbers are expressed by the two's complement.
18: Several byte orders including the network byte order
19: are allowed and the byte order is determined as a part of
1.5 ! noro 20: the establishment of a connection. See Section \ref{secsession} for details.
1.1 takayama 21:
1.4 ohara 22: The OX messages are classified into three types:
1.5 ! noro 23: DATA, COMMAND, and SPECIAL.
1.1 takayama 24: We have the following main tags for the OX messages.
25: \begin{verbatim}
26: #define OX_COMMAND 513 // COMMAND
27: #define OX_DATA 514 // DATA
1.5 ! noro 28: #define OX_SYNC_BALL 515 // SPECIAL
1.1 takayama 29: #define OX_DATA_WITH_LENGTH 521 // DATA
30: #define OX_DATA_OPENMATH_XML 523 // DATA
31: #define OX_DATA_OPENMATH_BINARY 524 // DATA
32: #define OX_DATA_MP 525 // DATA
33: \end{verbatim}
34:
35: New OX tags may be added.
36: The new tag should be classified into DATA or COMMAND.
1.2 takayama 37: For example, \verb+ OX_DATA_ASIR_LOCAL_BINARY + was added a few month ago
38: to send internal serialized objects of asir via the OpenXM protocol.
1.4 ohara 39: This is a tag classified to DATA.
40: See the web page of OpenXM to add a new tag.
1.5 ! noro 41: The server is a stack machine (see Section~\ref{sec:ox-stackmachines}
! 42: for detail).
! 43: {\it OX data} message sent by the client
! 44: are pushed onto the stack of the server.
! 45: If the server gets an {\it OX command} message, then the server extracts
! 46: a stack machine code in the OX command message and interprets the code.
1.4 ohara 47: For example, in case of SM\_executeFunction, some data are popped from
48: the stack and they are used as arguments of a function call.
49:
50: We explain an implementation of handling OX messages.
51: For example, the asir command {\tt ox\_push\_cmo(P,1)}
1.5 ! noro 52: (push integer $1$ onto the server $P$)
1.1 takayama 53: sends an OX data message
1.4 ohara 54: {\tt (OX\_DATA,(CMO\_ZZ,1))} to the server $P$.
1.1 takayama 55: Here,
56: OX\_DATA stands for OX\_DATA header and
1.4 ohara 57: {\tt (CMO\_ZZ,1)} is a body standing for $1$ expressed
1.2 takayama 58: in the CMO data encoding format.
1.4 ohara 59: The server tranlates $(CMO\_ZZ, 1)$ to its own internal object fotrmat
1.5 ! noro 60: for integers and pushs the object onto the stack.
1.1 takayama 61:
1.5 ! noro 62: %An OpenXM client admit that its own command sends some OX messages
! 63: %sequentially at once.
! 64: %
! 65: %For example, the asir command
! 66: %{\tt ox\_execute\_string(P, "Print[x+y]")} sends an OX data message
! 67: %{\tt (OX\_DATA, (CMO\_STRING, "Print[x+y]"))} and an OX command message
! 68: %{\tt (OX\_COMMAND, (SM\_executeStringByLocalParser))} to an OpenXM
! 69: %server.
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>