[BACK]Return to OpenXM.java CVS log [TXT][DIR] Up to [local] / OpenXM / src / OpenMath / ORG / openxm / tam

Diff for /OpenXM/src/OpenMath/ORG/openxm/tam/OpenXM.java between version 1.2 and 1.5

version 1.2, 2000/09/07 11:07:01 version 1.5, 2000/10/11 08:32:15
Line 1 
Line 1 
 /**  /**
  * $OpenXM: OpenXM/src/OpenMath/ORG/openxm/tam/OpenXM.java,v 1.1 2000/09/07 10:41:34 tam Exp $   * $OpenXM: OpenXM/src/OpenMath/ORG/openxm/tam/OpenXM.java,v 1.4 2000/09/13 06:32:43 tam Exp $
  */   */
 package ORG.openxm.tam;  package ORG.openxm.tam;
   
Line 8  import java.net.*;
Line 8  import java.net.*;
   
   
 /**  /**
  * OpenXM サーバとの接続を行なう抽象クラス.   * OpenXM サーバとの接続を行なうクラス.
  * クライアント側が使用する.   * クライアント側が使用する.
    * 接続するサーバ毎に一つの OpenXM クラスが必要.
  */   */
 public class OpenXM{  public class OpenXM{
   private OpenXMconnection control = null, stream = null;    private OpenXMstream control = null, stream = null;
   final protected boolean debug = false;    final protected boolean debug = false;
   
     /**
      * OpenXM サーバとの接続を TCP/IP ソケットを用いて行なう.
      * マシン名 host のポート番号 CtrlPort にコントロールを,
      * ポート番号 StreamPort にデータ用の接続を行なう.
      */
   public OpenXM(String host,int CtrlPort,int StreamPort) throws IOException{    public OpenXM(String host,int CtrlPort,int StreamPort) throws IOException{
     control = new OpenXMconnection(host,CtrlPort);      control = new OpenXMstream(host,CtrlPort);
   
     try{      try{
       Thread.sleep(100); // We need a few wait for starting up server.        Thread.sleep(100); // We need a few wait for starting up server.
Line 24  public class OpenXM{
Line 30  public class OpenXM{
       System.err.println(e.getMessage());        System.err.println(e.getMessage());
     }      }
   
     stream = new OpenXMconnection(host,StreamPort);      stream = new OpenXMstream(host,StreamPort);
   
     control.sendByteOrder();      control.sendByteOrder();
     stream.sendByteOrder();      stream.sendByteOrder();
   }    }
   
   /**    /**
    * 接続の reset を行なう. 現在は未実装.     * 接続の初期化を行なう. 現在は未実装.
    */     */
   public synchronized void resetConnection(){    public synchronized void resetConnection(){
     debug("control: stopping computer process...");      debug("control: stopping computer process...");
Line 39  public class OpenXM{
Line 45  public class OpenXM{
   }    }
   
   /**    /**
    * OpenXM メッセージを送信する. ただし、このメソッドは     * OpenXM メッセージをデータストリームに送信する.
    * ボディの部分だけでよい. ヘッダの部分は自動で付加される.     * このメソッドはメッセージのボディの部分だけでよい.
      * ヘッダ部分は自動で付加される.
    */     */
   public void send(OXbody object) throws IOException,MathcapViolation{    public void send(OXbody object) throws IOException,MathcapViolation{
     stream.send(object);      stream.send(object);
   }    }
   
   /**    /**
    * OpenXM メッセージを受け取る.     * データストリームから OpenXM メッセージを受け取る.
    */     */
   public OXmessage receive() throws IOException{    public OXmessage receive() throws IOException{
     return stream.receive();      return stream.receive();
   }    }
   
   /**    /**
    * MathCap を mathcap に設定する.     * データストリームの MathCap を mathcap に設定する.
    * 以後, mathcap に反した CMO を送ると     * 以後, 送信するオブジェクトは mathcap に合っているかどうか
    * MathcapViolation が発生する.     * チェックが入る. 実際にチェックが入るかどうかは
      * OXbody クラスの派生クラスの実装による.
      * mathcap に反したオブジェクトを送ろうとした時には,
      * 以後 MathcapViolation が発生することが期待される.
    */     */
   public void setMathCap(CMO_MATHCAP mathcap){    public void setMathCap(CMO_MATHCAP mathcap){
     stream.setMathCap(mathcap);      stream.setMathCap(mathcap);
Line 77  public class OpenXM{
Line 87  public class OpenXM{
   
     for(int i=0;i<argv.length;i++){      for(int i=0;i<argv.length;i++){
       if(argv[i].equals("-h")){        if(argv[i].equals("-h")){
         System.out.println("");          System.err.println("");
         System.exit(0);          System.exit(0);
       }else if(argv[i].equals("-host")){        }else if(argv[i].equals("-host")){
         hostname = argv[++i];          hostname = argv[++i];
Line 151  public class OpenXM{
Line 161  public class OpenXM{
       e.printStackTrace();        e.printStackTrace();
     }      }
   
     System.out.println("breaking...");      System.err.println("breaking...");
   
     try{      try{
       // close connection        // close connection

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.5

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>