version 1.7, 2000/11/17 02:50:04 |
version 1.11, 2016/08/22 09:23:31 |
|
|
%% $OpenXM: OpenXM/doc/OpenXM-specs/control.tex,v 1.6 2000/07/27 09:51:04 ohara Exp $ |
%% $OpenXM: OpenXM/doc/OpenXM-specs/control.tex,v 1.10 2016/08/22 09:08:50 takayama Exp $ |
\section{Session Management} |
\section{Session Management} |
|
|
\subsection{Control server} |
\subsection{Control server} |
Line 36 OpenXM stack machine and it accepts {\tt SM\_control\_ |
|
Line 36 OpenXM stack machine and it accepts {\tt SM\_control\_ |
|
to send signals to a server or to terminate a server. |
to send signals to a server or to terminate a server. |
*/ |
*/ |
|
|
\subsection{New specification for OpenXM control servers} |
\subsection{New OpenXM control servers} |
|
|
/*&jp |
/*&jp |
|
OpenXM RFC 101 Draft ¤ò¸«¤è |
²æ¡¹¤Ï¿·¤·¤¤¥³¥ó¥È¥í¡¼¥ë¥µ¡¼¥Ð¤òÄó°Æ¤¹¤ë¡£¤½¤Î¥µ¥ó¥×¥ë¼ÂÁõ¤È¤·¤Æ oxc ¤¬ |
\htmladdnormallink{http://www.math.kobe-u.ac.jp/OpenXM/OpenXM-RFC.html}{http://www.math.kobe-u.ac.jp/OpenXM/OpenXM-RFC.html}. |
Ä󶡤µ¤ì¤ë¡£¿·¤·¤¤¥³¥ó¥È¥í¡¼¥ë¥µ¡¼¥Ð¤Ï°Ê²¼¤ÎÅÀ¤Ç½¾Íè¤Î¤â¤Î¤È°Û¤Ê¤ë¡£ |
|
\begin{enumerate} |
|
\item ¥³¥ó¥È¥í¡¼¥ë¥µ¡¼¥Ð¤Ï OpenXM ¥¹¥¿¥Ã¥¯¥Þ¥·¥ó¤Ç¤¢¤ê¡¢ |
|
CMObject/Primitive ¤ò¥µ¥Ý¡¼¥È¤¹¤ë¡£ |
|
\item ·×»»¥µ¡¼¥Ð¤Îµ¯Æ°¤Ï¥¹¥¿¥Ã¥¯¥Þ¥·¥ó¥³¥Þ¥ó¥É¤ò²ð¤·¤Æ¹Ô¤¦¡£ |
|
\item °ì¤Ä¤Î¥³¥ó¥È¥í¡¼¥ë¥µ¡¼¥Ð¤«¤éÊ£¿ô¤Î·×»»¥µ¡¼¥Ð¤òµ¯Æ°¤Ç¤¤ë¡£ |
|
\end{enumerate} |
|
|
|
oxc ¤ÎƳÆþ¤Ë¤è¤ê¡¢¤¤¤Þ¤Þ¤Ç¤Î¥µ¡¼¥Ð¤Îµ¯Æ°¼ê½ç¤Ï¥³¥ó¥È¥í¡¼¥ë¥µ¡¼¥Ð¤Îµ¯Æ°¤È |
|
·×»»¥µ¡¼¥Ð¤Îµ¯Æ°¤ËʬΥ¤µ¤ì¤ë¡£¥³¥ó¥È¥í¡¼¥ë¥µ¡¼¥Ð¤òµ¯Æ°¤¹¤ë¤Ë¤Ï¼¡¤Î¼ê½ç¤ò |
|
¼è¤ë¡£¤Þ¤º¡¢Å¬Åö¤Ê¥ª¥×¥·¥ç¥ó(¸å½Ò)¤ò¤Ä¤±¤Æ¡¢¥³¥ó¥È¥í¡¼¥ë¥µ¡¼¥Ð¤òµ¯Æ°¤¹¤ë |
|
¤È¡¢¥³¥ó¥È¥í¡¼¥ë¥µ¡¼¥Ð¤Ï¥½¥±¥Ã¥È¤òºîÀ®¤·¡¢connect ¤¹¤ë¡£¥¯¥é¥¤¥¢¥ó¥È¤Ï¡¢ |
|
listen, accept ¤¹¤ë¡£Àܳ¸å¡¢¥Ð¥¤¥È¥ª¡¼¥À¤ò·èÄꤹ¤ë¡£¥Ð¥¤¥È¥ª¡¼¥À¤Î·èÄê |
|
¤Ë¤Ä¤¤¤Æ¤Ï???¤ò¸«¤è¡£¤½¤Î¸å¡¢¥³¥ó¥È¥í¡¼¥ë¥µ¡¼¥Ð¤ÏÂÔµ¡¾õÂ֤ˤϤ¤¤ë¡£¥³¥ó |
|
¥È¥í¡¼¥ë¥µ¡¼¥Ð¤Ï OpenXM ¥¹¥¿¥Ã¥¯¥Þ¥·¥ó¤Ç¤¢¤ë¤«¤é¡¢mathcap ¤Î¸ò´¹¤Ê¤É¤Î¼ê |
|
³¤¤ËÆþ¤Ã¤Æ¤â¤è¤¤¡£ |
|
|
|
·×»»¥µ¡¼¥Ð¤Îµ¯Æ°¤Ï¡¢oxc ¤Î¥í¡¼¥«¥ë´Ø¿ô oxc\_open ¤Ë¤è¤ë¡£oxc\_open ¤Ï¾¯ |
|
¤Ê¤¯¤È¤â 4 ¸Ä¤Î°ú¿ô¤ò»ý¤Ä¡£¤¹¤Ê¤ï¤Á¡¢ |
|
\begin{verbatim} |
|
oxc_open(·×»»¥µ¡¼¥Ð̾, ¥Û¥¹¥È̾, ¥Ý¡¼¥ÈÈÖ¹æ, ¥â¡¼¥É, ...) |
|
\end{verbatim} |
|
¤È¤¤¤¦·Á¼°¤Ç¤¢¤ë¡£¤³¤³¤Ç¡¢¡Ö·×»»¥µ¡¼¥Ð̾¡×¡¢¡Ö¥Û¥¹¥È̾¡×¤Ï CMO\_STRING |
|
·¿¤Î¥ª¥Ö¥¸¥§¥¯¥È¡¢¡Ö¥Ý¡¼¥ÈÈÖ¹æ¡×¡¢¡Ö¥â¡¼¥É¡×¤Ï CMO\_INT32·¿ |
|
¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤¢¤ë¡£¥Û¥¹¥È̾¤È¤¤¤¦¤Î¤ÏOpenXM¥¯¥é¥¤¥¢¥ó¥È¤Î¥Û |
|
¥¹¥È̾¤Î¤³¤È¤Ç¤¢¤ë¡£¥í¡¼¥«¥ë´Ø¿ô¤Î¼Â¹Ô¤Ï SM\_executeFunction ¤Ë¤è¤ë¡£¤¹ |
|
¤Ê¤ï¤Á³Æ°ú¿ô¤ò½ç¤Ë¥¹¥¿¥Ã¥¯¤ËÀѤߡ¢ºÇ¸å¤ËSM\_executeFunction ¤ò¼Â¹Ô¤¹¤ë¡£ |
|
SM\_executeStringByLocalParser ¤ÏÍøÍѤǤ¤Ê¤¤¤Î¤ÇÃí°Õ¤¹¤ë¡£ |
|
|
|
oxc\_open ¤Ï¡¢·×»»¥µ¡¼¥Ð¤Îµ¯Æ°¤ËÀ®¸ù¤·¤¿¤é (CMO\_INT32, ¥µ¡¼¥ÐID) ¤ò¡¢¼º |
|
ÇÔ¤·¤¿¤é¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È¤ò¥¹¥¿¥Ã¥¯¤ËÀѤࡣÎ㤨¤Ð·×»»¥µ¡¼¥Ð¤¬È¯¸«¤Ç¤¤Ê |
|
¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È¤òÀѤळ¤È¤Ë¤Ê¤ë¡£¥³¥ó¥È¥í¡¼¥ë¥µ¡¼¥Ð¤Ï |
|
access(2) ¤òÍѤ¤¤Æ PATH ¤«¤é·×»»¥µ¡¼¥Ð¤òõ¤¹¡£¤â¤·¸«¤Ä¤«¤é¤Ê¤±¤ì¤Ð¡¢fork |
|
¤ò¤»¤º¤Ë¡¢¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È¤ò¥¹¥¿¥Ã¥¯¤ËÀѤࡣ |
|
|
|
¥³¥ó¥È¥í¡¼¥ë¥µ¡¼¥Ð¤Î¼Â¹Ô·Á¼°¤Ï°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤òµö¤¹¡£ |
|
\begin{verbatim} |
|
--pass |
|
--host |
|
--port |
|
\end{verbatim} |
|
*/ |
*/ |
|
/*&eg |
|
See OpenXM RFC 101 Draft. |
|
\htmladdnormallink{http://www.math.kobe-u.ac.jp/OpenXM/OpenXM-RFC.html}{http://www.math.kobe-u.ac.jp/OpenXM/OpenXM-RFC.html}. |
|
*/ |
|
|
|
|
|
|
\subsection{OpenXM reset protocol} |
\subsection{OpenXM reset protocol} |
|
|
/*&jp |
/*&jp |
|
|
\begin{tabular}{|c|c|} \hline |
\begin{tabular}{|c|c|} \hline |
{\tt int32 OX\_DATA} & {\tt CMO\_INT32} {\rm result} \\ |
{\tt int32 OX\_DATA} & {\tt CMO\_INT32} {\rm result} \\ |
\hline |
\hline |
\end{tabular} |
\end{tabular}\\ |
|
/*&jp |
|
¤¹¤Ù¤Æ¥¨¥ó¥¸¥ó¤Ï reset protocol ¤ò¼ÂÁõ¤¹¤ë¤³¤È¤¬¿ä¾©¤µ¤ì¤ë¤¬, |
|
¼ÂÁõ¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï, mathcap ¤ÎÂ裴°ú¿ô¤Î option list ¤Ç |
|
{\tt no\_ox\_reset} ¤òÁ÷¿®¤¹¤Ù¤¤Ç¤¢¤ë (»²¾È: oxpari). |
|
*/ |
|
/*&eg |
|
All engines are encouraged to install the reset protocol, |
|
but when it is not implemented, |
|
{\tt no\_ox\_reset} option should be included in the fourth argument |
|
(option list) of the mathcap (ref: oxpari). |
|
*/ |
|
|
\item |
\item |
\begin{verbatim} |
\begin{verbatim} |
Line 285 OpenXM ¥µ¡¼¥Ð¤Ï, ²Äǽ¤Ç¤¢¤ë¤«¤®¤ê²ÉÌۤǤ¢¤ë. |
|
Line 256 OpenXM ¥µ¡¼¥Ð¤Ï, ²Äǽ¤Ç¤¢¤ë¤«¤®¤ê²ÉÌۤǤ¢¤ë. |
|
¤«¤®¤ê²¿¤âÁ÷¿®¤·¤Ê¤¤. |
¤«¤®¤ê²¿¤âÁ÷¿®¤·¤Ê¤¤. |
*/ |
*/ |
/*&eg |
/*&eg |
OpenXM servers try to be quiet as far as possible. |
OpenXM servers try to be as quiet as possible. |
For example, engine errors of a server are only put on the engine stack and |
For example, engine errors of a server are only put on the engine stack and |
the engine does not send error packets unless the client sends the message |
the engine does not send error packets unless the client sends the message |
{\tt pop\_cmo}. |
{\tt pop\_cmo}. |
Line 299 OpenXM ¤Ï¤³¤Î¸¶Â§¤ò¤ä¤Ö¤ëÎ㳰Ū¤ÊÊýË¡¤ò°ì¤ÄÍÑ°Õ¤·¤Æ¤¤¤ |
|
Line 270 OpenXM ¤Ï¤³¤Î¸¶Â§¤ò¤ä¤Ö¤ëÎ㳰Ū¤ÊÊýË¡¤ò°ì¤ÄÍÑ°Õ¤·¤Æ¤¤¤ |
|
¤³¤Îµ¡Ç½¤Ï mathcap ¤Ç¶Ø»ß¤¹¤ë¤³¤È¤â²Äǽ¤Ç¤¢¤ë. |
¤³¤Îµ¡Ç½¤Ï mathcap ¤Ç¶Ø»ß¤¹¤ë¤³¤È¤â²Äǽ¤Ç¤¢¤ë. |
*/ |
*/ |
/*&eg |
/*&eg |
OpenXM provides a method to break this principle. |
OpenXM provides a method to notify events. |
Control server may send {\tt OX\_NOTIFY} header and an {\tt OX\_DATA} packet. |
Control server may send {\tt OX\_NOTIFY} header and an {\tt OX\_DATA} packet. |
This transmission can be prohibited by mathcap. |
This transmission may be prohibited by mathcap. |
*/ |
*/ |
|
|
/*&jp |
/*&jp |
Line 314 quit ¥Ü¥¿¥ó¤¬¤ª¤µ¤ì¤ë¤È canvas ¤¬¾ÃÌǤ¹¤ë¤¬, ¥¨¥ó¥¸¥ó¼ |
|
Line 285 quit ¥Ü¥¿¥ó¤¬¤ª¤µ¤ì¤ë¤È canvas ¤¬¾ÃÌǤ¹¤ë¤¬, ¥¨¥ó¥¸¥ó¼ |
|
{\tt OX\_NOTIFY} ¤òÍѤ¤¤ë. |
{\tt OX\_NOTIFY} ¤òÍѤ¤¤ë. |
*/ |
*/ |
/*&eg |
/*&eg |
Let us explain how to use {\tt OX\_NOTIFY}. |
Let us explain how to use {\tt OX\_NOTIFY} by an example. |
The {\tt ox\_plot} server of {\tt asir} has a quit button. |
The {\tt ox\_plot} server of {\tt asir} has a quit button. |
If the quit button is pressed, the canvas dissappears, but the engine |
If the quit button is pressed, the canvas dissappears, but the engine |
does not terminate. |
does not terminate. |
Line 330 the {\tt OX\_NOTIFY} message should be used. |
|
Line 301 the {\tt OX\_NOTIFY} message should be used. |
|
¤¢¤ë¤³¤È¤ËÃí°Õ¤·¤è¤¦. |
¤¢¤ë¤³¤È¤ËÃí°Õ¤·¤è¤¦. |
¤·¤¿¤¬¤Ã¤Æ¥¨¥ó¥¸¥ó¤Ï¤Ê¤ó¤é¤«¤ÎÊýË¡¤Ç, ¥³¥ó¥È¥í¡¼¥ë¥µ¡¼¥Ð¤Ë |
¤·¤¿¤¬¤Ã¤Æ¥¨¥ó¥¸¥ó¤Ï¤Ê¤ó¤é¤«¤ÎÊýË¡¤Ç, ¥³¥ó¥È¥í¡¼¥ë¥µ¡¼¥Ð¤Ë |
{\tt OX\_NOTIFY} ¤ò¤ª¤¯¤ë¤³¤È¤ò°ÍÍꤷ¤Ê¤¤¤È¤¤¤±¤Ê¤¤. |
{\tt OX\_NOTIFY} ¤ò¤ª¤¯¤ë¤³¤È¤ò°ÍÍꤷ¤Ê¤¤¤È¤¤¤±¤Ê¤¤. |
OpenXM ¤Îµ¬³Ê¤Ç¤Ï, |
¤³¤ÎÊýË¡¤Ï, OS ¤Ë¤è¤ê¤¤¤í¤¤¤í¤ÊÊýË¡¤¬²Äǽ¤À¤«, |
¥Õ¥¡¥¤¥ë {\tt /tmp/.ox\_notify.pid} ¤Ë touch ¤¹¤ë¤³¤È¤Ç¤³¤ì¤Î |
¤¿¤È¤¨¤Ð, unix ¤Ç¤Ï |
°ì¤Ä¤Î¼Â¸½ÊýË¡¤òÍ¿¤¨¤Æ¤¤¤ë. |
¥Õ¥¡¥¤¥ë {\tt /tmp/.ox\_notify.pid} ¤Ë touch ¤¹¤ë¤³¤È¤Ç¤³¤ì¤ò |
|
°ì¤Ä¤Î¼Â¸½¤¹¤ë¤³¤È¤¬²Äǽ¤Ç¤¢¤ë. |
¤³¤³¤Ç {\tt pid} ¤Ï¥¨¥ó¥¸¥ó¤Î¥×¥í¥»¥¹ÈÖ¹æ¤Ç¤¢¤ë. |
¤³¤³¤Ç {\tt pid} ¤Ï¥¨¥ó¥¸¥ó¤Î¥×¥í¥»¥¹ÈÖ¹æ¤Ç¤¢¤ë. |
¥³¥ó¥È¥í¡¼¥ë¥µ¡¼¥Ð¤Ï¥Õ¥¡¥¤¥ë {\tt /tmp/.ox\_notify.pid} ¤¬ |
¥³¥ó¥È¥í¡¼¥ë¥µ¡¼¥Ð¤Ï¥Õ¥¡¥¤¥ë {\tt /tmp/.ox\_notify.pid} ¤¬ |
touch ¤µ¤ì¤¿¤³¤È¤ò¸¡½Ð¤·¤¿¤é, ¥¯¥é¥¤¥¢¥ó¥È¤Ë |
touch ¤µ¤ì¤¿¤³¤È¤ò¸¡½Ð¤·¤¿¤é, ¥¯¥é¥¤¥¢¥ó¥È¤Ë |
Line 341 touch ¤µ¤ì¤¿¤³¤È¤ò¸¡½Ð¤·¤¿¤é, ¥¯¥é¥¤¥¢¥ó¥È¤Ë |
|
Line 313 touch ¤µ¤ì¤¿¤³¤È¤ò¸¡½Ð¤·¤¿¤é, ¥¯¥é¥¤¥¢¥ó¥È¤Ë |
|
¶¦Í¥á¥â¥ê¤ä¥·¥°¥Ê¥ë¤òÍѤ¤¤Æ¤·¤é¤»¤Æ¤â¤è¤¤. |
¶¦Í¥á¥â¥ê¤ä¥·¥°¥Ê¥ë¤òÍѤ¤¤Æ¤·¤é¤»¤Æ¤â¤è¤¤. |
*/ |
*/ |
/*&eg |
/*&eg |
Let us note that it is the control process that sends {\tt OX\_NOTIFY}. |
Let us note that only the control process is allowed to send {\tt OX\_NOTIFY}. |
Therefore, the engine must ask the control server to send |
Therefore, the engine must ask the control server to send |
{\tt OX\_NOTIFY}. |
{\tt OX\_NOTIFY}. |
In the OpenXM, if the engine touches the file |
Methods to ask the control process from the engine |
|
depends on operating system. |
|
In case of unix, one method is the use of a file; |
|
for instance, |
|
if the engine touches the file |
{\tt /tmp/.ox\_notify.pid}, then the control server sends |
{\tt /tmp/.ox\_notify.pid}, then the control server sends |
the {\tt OX\_NOTIFY} header and the {\tt OX\_DATA} packet |
the {\tt OX\_NOTIFY} header and the {\tt OX\_DATA} packet |
of {\tt cmo\_null}. |
of {\tt cmo\_null}. |
Here, {\tt pid} is the process id of the engine. |
Here, {\tt pid} is the process id of the engine. |
Engines and control processes may use a shared memory or a signal |
Engines and control processes may use a shared memory or a signal |
instead of the file {\tt /tmp.ox\_notify.pid}. |
instead of the file {\tt /tmp/.ox\_notify.pid}. |
*/ |
*/ |