%%$OpenXM: OpenXM/doc/calc2000/ox-messages.tex,v 1.2 2000/04/24 05:01:29 noro Exp $

\section{OX messages}

An OX message for TCP/IP is a byte stream consisting of
a header and a body.
\begin{center}
\begin{tabular}{|c|c|}
\hline
Header	& \hspace{10mm} Body \hspace{10mm} \\
\hline
\end{tabular}
\end{center}
The header consists of two signed 32 bit integers.
The first one is an OX tag 
and the second one is a serial number of the OX message.
%Negative numbers are expressed by the two's complement.
Several byte orders including the network byte order
are allowed and the byte order is determined as a part of
the establishment of a connection. See Section \ref{secsession} for details.

The OX messages are classified into three types:
COMMAND, DATA and SPECIAL.
We have currently the following general tags for the OX messages.
\begin{description}
\item{COMMAND}
{\tt OX\_COMMAND}
\item{DATA}
{\tt OX\_DATA}, {\tt OX\_DATA\_WITH\_LENGTH}, {\tt OX\_DATA\_OPENMATH\_XML},

{\tt OX\_DATA\_OPENMATH\_BINARY} {\tt OX\_DATA\_MP} \item{SPECIAL} {\tt OX\_SYNC\_BALL}
\end{description}

A new OX tag may be added.
The new tag should be classified into DATA or COMMAND.
For example, \verb+ OX_DATA_ASIR_LOCAL_BINARY +  was added recently
to send internal serialized objects of Asir via the OpenXM protocol.
This is a tag classified to DATA.
See the web page of OpenXM to add a new tag \cite{openxm-web}.

%An OpenXM client admit that its own command sends some OX messages
%sequentially at once.  
%
%For example, the asir command
%{\tt ox\_execute\_string(P, "Print[x+y]")} sends an OX data message
%{\tt (OX\_DATA, (CMO\_STRING, "Print[x+y]"))} and an OX command message
%{\tt (OX\_COMMAND, (SM\_executeStringByLocalParser))} to an OpenXM
%server.
