version 1.10, 2002/10/27 10:39:32 |
version 1.11, 2021/03/29 02:35:12 |
|
|
/** |
/** |
* $OpenXM: OpenXM/src/OpenMath/ORG/openxm/tam/OpenXM.java,v 1.9 2002/10/23 08:40:16 takayama Exp $ |
* $OpenXM: OpenXM/src/OpenMath/ORG/openxm/tam/OpenXM.java,v 1.10 2002/10/27 10:39:32 takayama Exp $ |
*/ |
*/ |
package ORG.openxm.tam; |
package ORG.openxm.tam; |
|
|
Line 8 import java.net.*; |
|
Line 8 import java.net.*; |
|
|
|
|
|
/*&ja |
/*&ja |
OpenXM サーバとの接続を行なうクラス. |
OpenXM 泣若・膓茵. |
クライアント側が使用する. |
ゃ≪潟眼篏睡. |
接続するサーバ毎に一つの OpenXM クラスが必要. |
・膓泣若罸筝ゃ OpenXM 鴻綽荀. |
*/ |
*/ |
/** |
/** |
* OpenXM is a class to connect to OpenXM servers, |
* OpenXM is a class to connect to OpenXM servers, |
Line 23 public class OpenXM{ |
|
Line 23 public class OpenXM{ |
|
final protected boolean debug = false; |
final protected boolean debug = false; |
|
|
/*&ja |
/*&ja |
* OpenXM サーバとの接続を TCP/IP ソケットを用いて行なう. |
* OpenXM 泣若・膓 TCP/IP 純宴茵. |
* マシン名 host のポート番号 CtrlPort にコントロールを, |
* 激喝 host 若 CtrlPort 潟潟若, |
* ポート番号 StreamPort にデータ用の接続を行なう. |
* 若 StreamPort 若睡・膓茵. |
*/ |
*/ |
/** |
/** |
* Connect to an OpenXM server via TCP/IP socket. |
* Connect to an OpenXM server via TCP/IP socket. |
Line 54 public class OpenXM{ |
|
Line 54 public class OpenXM{ |
|
} |
} |
|
|
/*&ja |
/*&ja |
* コマンド command を立ち上げ、 |
* 潟潟 command 腴> |
* OpenXM サーバとの接続を TCP/IP ソケットを用いて行なう. |
* OpenXM 泣若・膓 TCP/IP 純宴茵. |
* マシン名 host のポート番号 CtrlPort にコントロールを, |
* 激喝 host 若 CtrlPort 潟潟若, |
* ポート番号 StreamPort にデータ用の接続を行なう. |
* 若 StreamPort 若睡・膓茵. |
*/ |
*/ |
/** |
/** |
* First, execute a command, which is usually an OpenXM server, |
* First, execute a command, which is usually an OpenXM server, |
Line 134 public OpenXM(String ox_server) throws IOException { |
|
Line 134 public OpenXM(String ox_server) throws IOException { |
|
|
|
|
|
/*&ja |
/*&ja |
* サーバの計算中断を行なう. 現在は未実装. |
* 泣若荐膊筝茵. 憜絎茖. |
*/ |
*/ |
/** |
/** |
* Resetting the engine process. It has not yet been implemented. |
* Resetting the engine process. It has not yet been implemented. |
Line 145 public OpenXM(String ox_server) throws IOException { |
|
Line 145 public OpenXM(String ox_server) throws IOException { |
|
} |
} |
|
|
/*&ja |
/*&ja |
* OpenXM メッセージをデータストリームに送信する. |
* OpenXM <祉若吾若帥鴻若篆<. |
* このメソッドはメッセージのボディの部分だけでよい. |
* <純<祉若吾cс. |
* ヘッダ部分は自動で付加される. |
* т. |
*/ |
*/ |
/** |
/** |
* Send an OpenXM message object. |
* Send an OpenXM message object. |
Line 160 public OpenXM(String ox_server) throws IOException { |
|
Line 160 public OpenXM(String ox_server) throws IOException { |
|
} |
} |
|
|
/*&ja |
/*&ja |
* データストリームから OpenXM メッセージを受け取る. |
* 若帥鴻若 OpenXM <祉若吾. |
*/ |
*/ |
/** |
/** |
* Receive an OpenXM message. |
* Receive an OpenXM message. |
Line 170 public OpenXM(String ox_server) throws IOException { |
|
Line 170 public OpenXM(String ox_server) throws IOException { |
|
} |
} |
|
|
/*&ja |
/*&ja |
* データストリームの MathCap を mathcap に設定する. |
* 若帥鴻若 MathCap mathcap 荐絎. |
* 以後, 送信するオブジェクトは mathcap に合っているかどうか |
* 篁ュ, 篆<吾с mathcap c |
* チェックが入る. 実際にチェックが入るかどうかは |
* сャ. 絎сャ |
* OXbody クラスの派生クラスの実装による. |
* OXbody 鴻羇丞鴻絎茖. |
* mathcap に反したオブジェクトを送ろうとした時には, |
* mathcap 吾с, |
* 以後 MathcapViolation が発生することが期待される. |
* 篁ュ MathcapViolation 榊緇. |
*/ |
*/ |
/** |
/** |
* Set the mathcap. |
* Set the mathcap. |
Line 232 public OpenXM(String ox_server) throws IOException { |
|
Line 232 public OpenXM(String ox_server) throws IOException { |
|
} |
} |
|
|
try{ |
try{ |
//サーバ側へ文字列を送信します。 |
//泣若眼御絖篆<障 |
ox.send(new SM(SM.SM_mathcap)); |
ox.send(new SM(SM.SM_mathcap)); |
ox.send(new SM(SM.SM_popString)); |
ox.send(new SM(SM.SM_popString)); |
|
|
Line 266 public OpenXM(String ox_server) throws IOException { |
|
Line 266 public OpenXM(String ox_server) throws IOException { |
|
|
|
//os.flush(); |
//os.flush(); |
|
|
//サーバ側から送信された文字列を受信します。 |
//泣若眼篆<絖篆<障 |
while(true){ |
while(true){ |
ox.receive(); |
ox.receive(); |
} |
} |