next up previous contents
: How to start a : Session Management : Control message (SMObject/TCPIP/Control)   ܼ

Notification from servers

OpenXM servers try to be as quiet as possible. 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 pop_cmo.

OpenXM provides a method to notify events. Control server may send OX_NOTIFY header and an OX_DATA packet. This transmission may be prohibited by mathcap.

Let us explain how to use OX_NOTIFY by an example. The ox_plot server of asir has a quit button. If the quit button is pressed, the canvas dissappears, but the engine does not terminate. If the client sends drawing messages without the canvas, then the engine pushes error packets ``canvas does not exist'' on the engine stack. If the engine wants to notify the error to the client immediately, the OX_NOTIFY message should be used.

Let us note that only the control process is allowed to send OX_NOTIFY. Therefore, the engine must ask the control server to send OX_NOTIFY. 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 /tmp/.ox_notify.pid, then the control server sends the OX_NOTIFY header and the OX_DATA packet of cmo_null. Here, pid is the process id of the engine. Engines and control processes may use a shared memory or a signal instead of the file /tmp/.ox_notify.pid.


next up previous contents
: How to start a : Session Management : Control message (SMObject/TCPIP/Control)   ܼ
Nobuki Takayama Heisei 28.8.27.